0, 'id' => $store_id]); if (!$store || empty($code)) { \Yii::error('<====================>授权回调 参数错误, 参数为:' . json_encode($data)); echo '授权失败,参数错误'; return; } $res = self::access_token($store_id, $code); if ($res['code'] != 0) { \Yii::error('<====================> token解析失败, 参数为:' . json_encode($res)); echo '授权失败,token解析失败,错误信息:' . $res['msg']; }else{ $data = $res['data']; self::saveConf($store_id, $data); echo '授权成功!'; self::refreshToken($store_id); die; } } public static function cb_token_unbind($data){ try{ $token = $data['token']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($token)) { debug_log('<====================>授权解绑回调 参数错误, 参数为:' . json_encode($data), __CLASS__ . '.log'); throw new \Exception('授权解绑失败,参数错误'); } self::setConf($store_id, 'token', ''); self::setConf($store_id, 'is_open', '0'); return [ 'code' => 0, 'msg' => '授权解绑成功!', ]; } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_confirm($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_order_confirm($store_id, $order_id); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_delivery_change($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_delivery_change($store_id, $order_id, $data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_change($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_order_change($store_id, $order_id, $data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_multi_rider_location($data){ try{ if (empty($data['locations'])) { throw new \Exception('参数错误'); } return self::data_multi_rider_location($data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_list($data){ try{ $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store) { throw new \Exception('参数错误'); } return self::data_order_list($store_id, $data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_detail($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_order_detail($store_id, $order_id); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_agree_refund($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_order_agree_refund($store_id, $order_id, $data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } public static function cb_order_reject_refund($data){ try{ $order_id = $data['order_id']; $store_id = $data['shop_id']; $store = Store::findOne(['is_delete' => 0, 'id' => $store_id]); if (!$store || empty($order_id)) { throw new \Exception('参数错误'); } return self::data_order_reject_refund($store_id, $order_id, $data); } catch (\Exception $ex) { debug_log([__FUNCTION__, __LINE__, $ex->getMessage()], __CLASS__ . '.log'); return [ 'code' => 1, 'msg' => '操作失败,错误信息:' . $ex->getMessage(), ]; } } }