request->post('code'); $data = [ 'user_id' => $this->user_id, 'code' => $code, ]; $result = $this->validate($data, 'app\api\validate\DistributionCode'); if ($result !== true) { $this->_error($result, [], 0, 0); } $result = DistributionLogic::code($code, $this->user_id); if ($result !== true) { $this->_error($result, [], 0, 0); } $this->_success(); } /** * 分销会员申请 */ public function apple() { $post = $this->request->post(); $post['user_id'] = $this->user_id; $result = $this->validate($post, 'app\api\validate\DistributionApply'); if ($result !== true) { $this->_error($result); } $result = DistributionLogic::apple($post,$this->user_id); if ($result !== true) { $this->_error($result); } $this->_success(); } /** * 最新的分销会员申请详情 * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function appleDetail() { $this->_success('',DistributionLogic::appleDetail($this->user_id)); } /** * User: 意象信息科技 mjf * Desc: 我的分销上级 */ public function myLeader() { $this->_success('', DistributionLogic::myLeader($this->user_id)); } /** * 分销推广主页信息 * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function index() { $this->_success('', DistributionLogic::index($this->user_id)); } /** * 分销订单 * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function order() { $get = $this->request->get(); $page = $this->request->get('page_no', $this->page_no); $size = $this->request->get('page_size', $this->page_size); $this->_success('', DistributionLogic::order($this->user_id, $get, $page, $size)); } /** * 月度账单 * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function monthBill() { $page = $this->request->get('page_no', $this->page_no); $size = $this->request->get('page_size', $this->page_size); $this->_success('', DistributionLogic::getMonthBill($this->user_id, $page, $size)); } /** * 月度账单明细 */ public function monthDetail() { $get = $this->request->get(); $page = $this->request->get('page_no', $this->page_no); $size = $this->request->get('page_size', $this->page_size); $this->_success('', DistributionLogic::getMonth($get, $this->user_id, $page, $size)); } /** * Notes: 分销会员页面判断 * @author 段誉(2021/2/1 18:45) */ public function check() { $user = User::get($this->user_id); if ($user['freeze_distribution'] == 1) { $this->_error('您已被冻结'); } if ($user['is_distribution'] == 1) { $this->_success('', '', 10001);//已是分销会员 } else { $this->_success('', '',20001);//未是分销会员 } } }