$_a(); } $agentId = get_params('agentId'); $store_id = get_params('cyy_store_id'); $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($agentId)) { \Yii::error('<====================>授权回调 参数错误, 参数为:' . json_encode($_GET)); echo '授权失败,参数错误'; exit; } $res = MochatForm::setConfAgentId($store_id, $agentId); if ($res['code'] != 0) { \Yii::error('<====================> token解析失败, 参数为:' . json_encode($res)); echo '授权失败,token解析失败,错误信息:' . $res['msg']; exit; } echo '授权成功!'; exit; } /** * 平台商品订单列表 * @return \yii\web\Response */ public function actionApi() { // debug_log(all_params(), __CLASS__ . '.log'); $_a = input_params('_a'); $store_id = input_params('store_id'); // $isopen = MochatForm::isopen($store_id); // if(!$isopen){ // return $this->asJson([ // 'code' => 1, // 'msg' => '未授权', // ]); // } if($_a && method_exists($this, $_a)){ $res = $this->$_a($store_id); return $res; } } /** * 平台商品订单列表 * @return \yii\web\Response */ public function orderList($store_id) { debug_log(all_params(), __CLASS__ . '.log'); // debug_log(post_params(), __CLASS__ . '.log'); // debug_log(get_params(), __CLASS__ . '.log'); // $form = new OrderListForm(); // $form->attributes = all_params(); // $form->store_id = $store_id; // return $this->asJson($form->search()); } public function order($store_id) { $wxExternalUserid = input_params('wxExternalUserid'); $roomId = input_params('roomId', input_params('wxChatId')); if(empty($wxExternalUserid) && empty($roomId)){ return $this->asJson([ 'code' => 1, 'msg' => '参数错误,缺少客户id或群id', ]); } $res = MochatForm::orderList($store_id, $wxExternalUserid, $roomId); return $this->asJson($res); } }