request; try { if ($request->isPost) { $post = $request->post(); $res = Yii::$app->services->validate->validate($post, [ [['level', 'district_id'], 'integer'], ]); if (!$res) throw new Exception(Yii::$app->services->validate->getErrorMessage()); $post['mall_id'] = $this->mall_id; $post['user_id'] = $this->user_id; $data = (new OrderService())->preview($post); return $this->success('操作成功', $data); } }catch (\Exception $e){ return $this->error($e->getMessage()); } } /** * 创建订单 * @Author bing * @DateTime 2021-09-22 09:31:22 * @return void * @copyright: Copyright (c) 2020 广东七件事集团 */ public function actionCreate() { $request = Yii::$app->request; try { if ($request->isPost) { $post = $request->post(); $res = Yii::$app->services->validate->validate($post, [ [['level', 'district_id'], 'integer'], ]); if (!$res) throw new Exception(Yii::$app->services->validate->getErrorMessage()); $post['mall_id'] = $this->mall_id; $post['user_id'] = $this->user_id; $data = (new OrderService())->created($post); return $this->success('操作成功', $data); } }catch (\Exception $e){ return $this->error($e->getMessage()); } } }