Memberpintuan.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * 查看我发起的拼团,用户查看参团以及开团的信息,以及分享
  4. */
  5. namespace app\api\controller;
  6. use think\facade\Lang;
  7. /**
  8. * ============================================================================
  9. *
  10. * ============================================================================
  11. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  12. * 网站地址: https://www.valimart.net/
  13. * ----------------------------------------------------------------------------
  14. *
  15. * ============================================================================
  16. * 拼团控制器
  17. */
  18. class Memberpintuan extends MobileMember {
  19. public function initialize() {
  20. parent::initialize();
  21. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/memberpintuan.lang.php');
  22. }
  23. /*
  24. * 查看我发起的拼团
  25. */
  26. public function pintuangroup()
  27. {
  28. $condition = array();
  29. $condition[] = array('pintuangroup_headid','=',$this->member_info['member_id']);
  30. $ppintuangroup_model = model('ppintuangroup');
  31. $ppintuanorder_model = model('ppintuanorder');
  32. $ppintuangroup_list = $ppintuangroup_model->getPpintuangroupList($condition, 10); #获取开团信息
  33. foreach ($ppintuangroup_list as $key => $ppintuangroup) {
  34. //获取开团订单下的参团订单
  35. $condition = array();
  36. $condition[] = array('pintuangroup_id','=',$ppintuangroup['pintuangroup_id']);
  37. $ppintuangroup_list[$key]['pintuangroup_starttime_text'] = date('Y-m-d H:i',$ppintuangroup['pintuangroup_starttime']);
  38. $ppintuangroup_list[$key]['pintuangroup_endtime_text'] = date('Y-m-d H:i',$ppintuangroup['pintuangroup_endtime']);
  39. if($ppintuangroup['pintuangroup_is_virtual']){
  40. $ppintuangroup_list[$key]['order_list'] = $ppintuanorder_model->getPpintuanvrorderList($condition);
  41. }else{
  42. $ppintuangroup_list[$key]['order_list'] = $ppintuanorder_model->getPpintuanorderList($condition);
  43. }
  44. }
  45. $pintuangroup_state_array = $ppintuangroup_model->getPintuangroupStateArray();
  46. $result = array_merge(array('list' => $ppintuangroup_list), mobile_page($ppintuangroup_model->page_info));
  47. ds_json_encode(10000, '',$result);
  48. }
  49. }