request; if ($retuest->isAjax) { if ($retuest->isGet) { $get = Yii::$app->request->get(); // 检查提交的参数 $res = Yii::$app->services->validate->validate($get,[ [['user_id','mobile'], 'integer'], [['manager_status'], 'string'] ]); if($res === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $where[] = ['=', 'mall_id', $this->mall_id]; $is_poss = $get['manager_status'] === 'normal' ? StatusEnum::ENABLED : StatusEnum::DISABLED; $where[] = ['=', 'is_poss', $is_poss]; !empty($get['user_id']) && $where[] = ['=', 'user_id', $get['user_id']]; !empty($get['mobile']) && $where[] = ['=', 'mobile', $get['mobile']]; $where[] = ['=', 'status', StatusEnum::ENABLED]; $with = ['user']; $order = 'created_at desc'; $params = array('where' => $where, 'order'=>$order, 'with' => $with, 'limit' => $get['limit']); $list = PurchaseManager::listPage($params, false, true); echo PurchaseManager::getStaticError(); $this->success('获取成功', $list); } } else { return $this->render($this->action->id, ['managerStatus' => 'normal']); } } /** * @notes:审核列表 * @return string * @author: lun * @Time: 2022/10/22 18:18 */ public function actionExamine() { return $this->render('index', ['managerStatus' => 'examine']); } /** * @notes:同意、拒绝、删除 * @return mixed|void|null * @author: lun * @Time: 2022/10/24 13:59 */ public function actionHandle() { $retuest = Yii::$app->request; if ($retuest->isAjax) { if ($retuest->isPost) { $post = Yii::$app->request->post(); // 检查提交的参数 $res = Yii::$app->services->validate->validate($post,[ [['id','status'], 'required'], [['id','status','is_poss'], 'integer'], [['reason'], 'string'], ]); if($res === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $res = PurchaseManager::handle($this->mall_id, $post); if ($res === false) return $this->error('操作失败:' . PurchaseManager::getStaticError()); return $this->success('操作成功'); } } } }