Memberpintuan.php 2.0 KB

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