| | |
| | | use app\api\model\branch\ActivityUser as ActivityUserModel; // 报名会员 |
| | | use app\api\model\branch\Member as MemberModel; // 会员 |
| | | use app\api\model\branch\ActivityFile as ActivityFileModel; // 活动文件 |
| | | use app\api\model\branch\ActivityCart as ActivityCartModel; // 活动购物车 |
| | | // use app\api\model\user\BalanceOrder as BalanceOrderModel; |
| | | // use app\common\enum\order\OrderPayTypeEnum; |
| | | use app\common\enum\order\OrderTypeEnum; |
| | |
| | | { |
| | | $model = new ActivityModel; |
| | | $list = $model->getList($category_id, $this->postData(), $this->getUser()); |
| | | return $this->renderSuccess('', compact('list')); |
| | | $words = BranchSettingModel::getItem('words'); |
| | | return $this->renderSuccess('', compact('list', 'words')); |
| | | } |
| | | |
| | | /** |
| | |
| | | $points = SettingModel::getItem('points'); |
| | | $detail['points_ratio'] = $points['discount']['discount_ratio']; // 积分抵扣比例 |
| | | // 获取报名用户列表 |
| | | $userList = (new ActivityUserModel())->getListForActivity(['activity_id' => $activity_id], false, 8); |
| | | $userList = (new ActivityUserModel())->getListForActivity(['activity_id' => $activity_id], false, 7); |
| | | return $this->renderSuccess('', compact('detail', 'userList')); |
| | | } |
| | | |
| | |
| | | return $this->renderSuccess('', compact('order_id')); |
| | | } |
| | | } |
| | | |
| | | public function getRegistrationInformation($user_id = 0,$activity_id=0) |
| | | { |
| | | // 生成报名用户 |
| | | $model = new ActivityUserModel(); |
| | | $user=$this->getUser(); |
| | | $userId = $user_id!=0?$user_id:$user['user_id']; |
| | | $registrationInformation = $model->getRegistrationInformation($userId,$activity_id); |
| | | return $this->renderSuccess('', compact('registrationInformation')); |
| | | } |
| | | /** |
| | | * 生成活动海报 |
| | | */ |
| | |
| | | $user->setIncPoints(-$points, $describe); |
| | | return $this->renderSuccess('', '扣除成功'); |
| | | } |
| | | |
| | | /** |
| | | * 活动商品列表 |
| | | **/ |
| | | public function productLists($activity_id) |
| | | { |
| | | $model = new ActivityModel(); |
| | | $activityDetail = $model->detail(['activity_id'=>$activity_id],[]); |
| | | |
| | | if (!$activityDetail) { |
| | | return $this->renderError('活动不存在'); |
| | | } |
| | | if ($activityDetail['status_text']['status'] != 1) { |
| | | return $this->renderError('活动未开始'); |
| | | } |
| | | $data = $this->postData(); |
| | | $user = $this->getUser(); |
| | | $check_result = $model->checkUserCanSome($activityDetail,$user,$data); |
| | | if(!$check_result){ |
| | | return $this->renderError($model->getError()); |
| | | } |
| | | $list = $model->getGoodsList($activity_id); |
| | | $cart_total_num = ( new ActivityCartModel())->where(['activity_id'=>$activity_id,'user_id'=>$user['user_id']])->count(); |
| | | return $this->renderSuccess('', compact('list','cart_total_num', 'activityDetail')); |
| | | } |
| | | } |