render('index', []); } /** * @Description: 获取会员数据 * @Author: ob3 * @DateTime 2022-10-21 17:31:45 * @return mixed */ public function actionGetPlatformUser() { if (\Yii::$app->request->isAjax) { $params = \Yii::$app->request->get(); $where = []; $where[] = ['mall_id' => $this->mall_id]; if (!empty($params['inviter_id'])) $where[] = ['id' => $params['inviter_id']]; if (!empty($params['keyword'])) $where[] = ['mobile' => $params['keyword']]; $user_list = User::listPage(['where' => $where]); if (!empty($user_list['list'])) { $user_level_arr = UserLevel::getUserLevelArr($params['mall_id']); foreach ($user_list['list'] as &$v) { $v['level_name'] = !empty($user_level_arr[$v['level']]) ? $user_level_arr[$v['level']] : MallSetting::getDefaultLevelName($this->mall_id); } } return $this->success('操作成功', ['list' => $user_list]); } } /** * 商品红包设置 * @Author: lun * @DateTime: 2022/3/23 0023 14:07 * @Copyright: copyright (c) 2021 广东七件事集团 */ public function actionGoodsSetting() { $request = Yii::$app->request; if ($request->isAjax && $request->isPost) { $post = Yii::$app->request->post(); $res = Yii::$app->services->validate->validate($post, [ [['goods_id', 'source'], 'required'], ]); if ($res === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $where[] = ['=', 'mall_id', $this->mall_id]; $where[] = ['=', 'goods_id', $post['goods_id']]; $where[] = ['=', 'status', StatusEnum::ENABLED]; if($post['source'] == 'Main'){ $where[] = ['in', 'source', ['Main','Store']]; }else{ $where[] = ['=', 'source', $post['source']]; } $select = "goods_id,wallet_type,is_enable,is_percent,give,deduct_type,deduct_money,settlement_method"; $params = compact('where', 'select'); $list = HigoGoodsSetting::lists($params); return $this->success('操作成功', $list); } } }