| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786 |
- <?php
- namespace app\modules\admin\models;
- use app\models\Admin;
- use app\models\District;
- use app\models\intracityService\IndexController;
- use app\models\Md;
- use app\models\Store;
- use app\models\WechatIntracityBalanceLog;
- use app\models\WechatIntracityService;
- use app\utils\Wechat\WechatMini;
- use EasyWeChat\Kernel\BaseClient;
- use yii\base\Model;
- class WechatDeliveryForm extends Model
- {
- public $store_id;
- public $md_id = 0;
- public $order_pattern;//运力偏好
- public $service_trans_prefer;//优先使用的运力ID
- public $flow_type; //流水类型 1:充值流水, 2:消费流水,3:退款流水
- public $out_store_id;//自定义门店编号
- public $store_name;//门店名称
- public $province;//省/自治区/直辖市
- public $city;//地级市
- public $area;// 县/县级市/区
- public $house;//具体门牌号或详细地址
- public $lat;//门店所在地纬度
- public $lng;//门店所在地经度
- public $phone;//门店联系电话
- public $street;//街道
- public $amount;
- public $begin_time;
- public $end_time;
- public $params;//检测运费所用
- public function rules()
- {
- return [
- [['store_id', 'md_id', 'order_pattern', 'flow_type'], 'integer'],
- [['service_trans_prefer', 'province', 'city', 'area', 'house', 'lat', 'lng', 'phone', 'out_store_id', 'store_name', 'street', 'begin_time', 'end_time'], 'string'],
- [['amount'], 'number']
- ];
- }
- ///cgi-bin/express/intracity/apply
- //申请门店
- public function applyStore(&$service) {
- try {
- $store_id = $this->store_id;
- $service = WechatIntracityService::findOne(['md_id' => $this->md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if ($service) {
- return [
- 'code' => 0,
- 'msg' => "成功"
- ];
- }
- $form = new IndexController();
- //申请门店不需要加签
- $result = $form->getUrlData($this->store_id, 'cgi-bin/express/intracity/apply', [], 1);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- $service = new WechatIntracityService();
- $service->md_id = $this->md_id;
- $service->store_id = $this->store_id;
- $service->save();
- return [
- 'code' => 0,
- 'msg' => "成功",
- 'data' => $result
- ];
- }
- throw new \Exception('申请失败' . $result['errmsg'], 1);
- } catch (\Exception $e) {
- return [
- 'code' => $e->getCode(),
- 'msg' => $e->getMessage()
- ];
- }
- }
- //创建/修改门店
- public function createStore() {
- try {
- // $params = $this->params;
- $order_pattern = (int)$this->order_pattern;
- $service_trans_prefer = $this->service_trans_prefer;
- $province = $this->province;
- $city = $this->city;
- $area = $this->area;
- $house = $this->house;
- $lat = $this->lat;
- $lng = $this->lng;
- $street = $this->street;
- $md_id = $this->md_id;
- $store_id = $this->store_id;
- //开通门店权限
- $service = WechatIntracityService::findOne(['md_id' => $this->md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (empty($service)) {
- $result = $this->applyStore($service);
- debug_log($result,'wx_store.log');
- if ($result['code'] !== 0) {
- return $result;
- }
- }
- $is_edit = 0;
- $out_store_id = "";
- if (!empty(trim($service->wx_store_id))) {
- $out_store_id = $service->out_store_id;
- $is_edit = 1;
- }
- if (empty($out_store_id)) {
- $out_store_id = sprintf("%04d", $store_id) . sprintf("%04d", $md_id);
- if ($this->out_store_id) {
- $out_store_id = $this->out_store_id;
- }
- }
- if ($md_id <= 0) {
- $store = Store::findOne($store_id);
- $store_name = $store->name ?: '';
- $admin = Admin::findOne(['type' => 'store', 'is_delete' => 0, 'type_id' => $store_id]);
- $phone = $admin->mobile ?: '';
- } else {
- $md = Md::findOne($md_id);
- $store_name = $md->name ?: '';
- $phone = $md->mobile ?: '';
- }
- if ($this->store_name) {
- $store_name = $this->store_name;
- }
- if ($this->phone) {
- $phone = $this->phone;
- }
- //检测
- if (empty(trim($out_store_id))) {
- throw new \Exception('需要填写自定义门店编号');
- }
- if (empty(trim($store_name))) {
- throw new \Exception('需要填写门店名称');
- }
- if (in_array($order_pattern, [1, 2])) {
- //1:价格优先,2:运力优先,
- if ($order_pattern === 2 && !$service_trans_prefer) {
- throw new \Exception('运力偏好为运力优先需要选择运力');
- }
- //运力ID只支持达达,顺丰同城
- if ($order_pattern === 2 && !in_array($service_trans_prefer, ['DADA', 'SFTC'])) {
- throw new \Exception('请选择运力且只能为达达、顺丰同城');
- }
- } else {
- throw new \Exception('需要选择运力偏好');
- }
- $province_name = District::findOne($province)->name;
- $city_name = District::findOne($city)->name;
- $area_name = District::findOne($area)->name;
- if (empty(trim($province_name)) || empty(trim($city_name)) || empty(trim($area_name)) || empty(trim($house))) {
- throw new \Exception('缺少省市区详细地址信息');
- }
- if (empty(trim($lat)) || empty(trim($lng))) {
- throw new \Exception('缺少经纬度信息');
- }
- if (empty(trim($phone))) {
- throw new \Exception('缺少门店联系电话');
- }
- if ($is_edit) {
- $data = [
- 'keys' => [
- 'out_store_id' => $out_store_id,
- ],
- 'content' => [
- 'store_name' => $store_name, //门店名称
- 'order_pattern' => $order_pattern, //运力偏好
- 'service_trans_prefer' => $service_trans_prefer, //优先使用的运力ID
- 'address_info' => [
- 'province' => $province_name,
- 'city' => $city_name,
- 'area' => $area_name,
- 'street' => $street,
- 'house' => $house,
- 'lat' => (float)$lat,
- 'lng' => (float)$lng,
- 'phone' => $phone
- ]
- ]
- ];
- $url = 'cgi-bin/express/intracity/updatestore';
- } else {
- $data = [
- 'out_store_id' => $out_store_id, //自定义门店编号
- 'store_name' => $store_name, //门店名称
- 'order_pattern' => $order_pattern, //运力偏好
- 'service_trans_prefer' => $service_trans_prefer, //优先使用的运力ID
- 'address_info' => [
- 'province' => $province_name,
- 'city' => $city_name,
- 'area' => $area_name,
- 'street' => $street,
- 'house' => $house,
- 'lat' => (float)$lat,
- 'lng' => (float)$lng,
- 'phone' => $phone
- ]
- ];
- $url = 'cgi-bin/express/intracity/createstore';
- }
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, $url, $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- if ($result['wx_store_id']) {
- $service->wx_store_id = $result['wx_store_id'];
- }
- $service->out_store_id = $out_store_id;
- $service->store_name = $store_name;
- $service->order_pattern = (int)$order_pattern;
- $service->service_trans_prefer = $service_trans_prefer;
- $service->address_info = json_encode([
- 'province' => $province,
- 'city' => $city,
- 'area' => $area,
- 'street' => $street,
- 'house' => $house,
- 'lat' => (float)$lat,
- 'lng' => (float)$lng,
- 'phone' => $phone
- ], JSON_UNESCAPED_UNICODE);
- if (!$service->save()) {
- throw new \Exception(json_encode($service->errors, JSON_UNESCAPED_UNICODE));
- }
- return [
- 'code' => 0,
- 'msg' => "成功",
- 'data' => array_merge([
- 'wx_store_id' => $result['wx_store_id']
- ], $data)
- ];
- }
- //偶尔会解密失败,所以直接查询,失败后让用户重试
- $result = $this->getStoreInfo();
- if ($result['code'] === 0) {
- return [
- 'code' => 0,
- 'msg' => '成功'
- ];
- }
- return $result;
- } catch (\Exception $e) {
- return [
- 'code' => $e->getCode() ?: 1,
- 'msg' => $e->getMessage(),
- 'line' => $e->getLine(),
- 'file' => $e->getFile()
- ];
- }
- }
- //获取
- public function getDeliveryStore() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $this->getStoreInfo();
- $service = WechatIntracityService::findOne(['md_id' => $this->md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- $service = $service->attributes;
- $out_store_id = sprintf("%04d", $store_id) . sprintf("%04d", $md_id);
- $md = Md::findOne($md_id);
- if (empty($service)) {
- $service = [
- 'out_store_id' => $out_store_id, //自定义门店编号
- 'store_name' => $md->name ?: '', //门店名称
- 'order_pattern' => 1, //运力偏好
- 'service_trans_prefer' => 'DADA', //优先使用的运力ID
- 'address_info' => json_encode([
- 'province' => '',
- 'city' => '',
- 'area' => '',
- 'street' => '',
- 'house' => '',
- 'lat' => (float)0,
- 'lng' => (float)0,
- 'phone' => $md->mobile ?: ''
- ])
- ];
- }
- $service['order_pattern'] = (int)$service['order_pattern'];
- $address_info = json_decode($service['address_info'], true) ?: [];
- unset($service['address_info']);
- $service = array_merge($service, $address_info);
- return [
- 'code' => 0,
- 'msg' => '获取成功',
- 'data' => $service
- ];
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- //调用接口获取信息
- public function getStoreInfo() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $service = WechatIntracityService::findOne(['md_id' => $md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (!$service) {
- throw new \Exception('暂未申请同城配送权限');
- }
- $out_store_id = $service->out_store_id;
- if (!$out_store_id) {
- $out_store_id = sprintf("%04d", $store_id) . sprintf("%04d", $md_id);
- }
- $data = [
- 'out_store_id' => $out_store_id
- ];
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, 'cgi-bin/express/intracity/querystore', $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- //传递out_store_id结果只有一行
- $store_list = $result['store_list'][0];
- $service->out_store_id = $store_list['out_store_id'];
- $service->wx_store_id = $store_list['wx_store_id'];
- if ($service->address_info) {
- $address_info = json_decode($store_list['address_info'], true);
- $address_info['street'] = $store_list['address_info']['street'] ?: '';
- $address_info['house'] = $store_list['address_info']['house'] ?: '';
- $address_info['lat'] = $store_list['address_info']['lat'] ?: '';
- $address_info['lng'] = $store_list['address_info']['lng'] ?: '';
- $address_info['phone'] = $store_list['address_info']['phone'] ?: '';
- } else {
- $address_info = $store_list['address_info'];
- }
- $service->address_info = json_encode($address_info, JSON_UNESCAPED_UNICODE);
- $service->order_pattern = $store_list['order_pattern'];
- $service->service_trans_prefer = $store_list['service_trans_prefer'];
- if (!$service->save()) {
- throw new \Exception(json_encode($service->errors, JSON_UNESCAPED_UNICODE));
- }
- return [
- 'code' => 0,
- 'msg' => '查询成功',
- 'service' => $service
- ];
- }
- throw new \Exception($result['errmsg'], $result['errcode']);
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- //门店充值 https://api.weixin.qq.com/cgi-bin/express/intracity/storecharge
- public function storeCharge() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $amount = $this->amount;
- $service_trans_prefer = $this->service_trans_prefer;
- $service = WechatIntracityService::findOne(['md_id' => $md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (!$service) {
- throw new \Exception('暂未申请同城配送权限');
- }
- if (!$service->wx_store_id) {
- throw new \Exception('缺少关键参数');
- }
- if (empty(trim($service_trans_prefer))) {
- throw new \Exception('请选择运力');
- }
- if ($amount < 50) {
- throw new \Exception('请输入充值金额,50元起充');
- }
- $data = [
- 'wx_store_id' => $service->wx_store_id,
- 'service_trans_id' => $service_trans_prefer,
- 'amount' => $amount * 100
- ];
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, 'cgi-bin/express/intracity/storecharge', $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- $payurl = $result['payurl'];
- return [
- 'code' => 0,
- 'msg' => '查询成功',
- 'data' => [
- 'payurl' => $payurl
- ]
- ];
- }
- throw new \Exception($result['errmsg'], $result['errcode']);
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- //门店退款 https://api.weixin.qq.com/cgi-bin/express/intracity/storerefund
- public function storeRefund() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $service_trans_prefer = $this->service_trans_prefer;
- $service = WechatIntracityService::findOne(['md_id' => $md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (!$service) {
- throw new \Exception('暂未申请同城配送权限');
- }
- if (!$service->wx_store_id) {
- throw new \Exception('缺少关键参数');
- }
- if (empty(trim($service_trans_prefer))) {
- throw new \Exception('请选择运力');
- }
- $data = [
- 'wx_store_id' => $service->wx_store_id,
- 'service_trans_id' => $service_trans_prefer,
- ];
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, 'cgi-bin/express/intracity/storerefund', $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- $refund_amount = $result['refund_amount'];
- return [
- 'code' => 0,
- 'msg' => '退款成功,共计退款' . ($refund_amount / 100),
- 'data' => [
- 'refund_amount' => ($refund_amount / 100)
- ]
- ];
- }
- throw new \Exception($result['errmsg'], $result['errcode']);
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- //门店余额查询 https://api.weixin.qq.com/cgi-bin/express/intracity/balancequery
- public function balanceQuery() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $service_trans_prefer = $this->service_trans_prefer;
- $service = WechatIntracityService::findOne(['md_id' => $md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (!$service) {
- throw new \Exception('暂未申请同城配送权限');
- }
- if (!$service->wx_store_id) {
- throw new \Exception('缺少关键参数');
- }
- $data = [
- 'wx_store_id' => $service->wx_store_id,
- 'service_trans_id' => $service_trans_prefer,
- ];
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, 'cgi-bin/express/intracity/balancequery', $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- $balance_arr = [];
- if ($result['balance_detail']) {
- foreach ($result['balance_detail'] as $index => $item) {
- $balance_arr[$index]['service_trans_name'] = $item['service_trans_name'];
- $balance_arr[$index]['service_trans_id'] = $item['service_trans_id'];
- $balance_arr[$index]['balance'] = ($item['balance'] / 100);
- }
- }
- $service->balance = json_encode($balance_arr, JSON_UNESCAPED_UNICODE);
- if (!$service->save()) {
- throw new \Exception(json_encode($service->errors, JSON_UNESCAPED_UNICODE));
- }
- return [
- 'code' => 0,
- 'msg' => '查询成功',
- 'data' => [
- 'balance_list' => $balance_arr
- ]
- ];
- }
- throw new \Exception($result['errmsg'], $result['errcode']);
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- //资金流水查询 https://api.weixin.qq.com/cgi-bin/express/intracity/queryflow
- public function queryFlow() {
- try {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $service_trans_prefer = $this->service_trans_prefer;
- $flow_type = $this->flow_type;
- $service = WechatIntracityService::findOne(['md_id' => $md_id, 'is_delete' => 0, 'store_id' => $store_id]);
- if (!$service) {
- throw new \Exception('暂未申请同城配送权限');
- }
- if (empty($service->wx_store_id)) {
- throw new \Exception('缺少关键参数');
- }
- if (!in_array($flow_type, [1, 2, 3])) {
- throw new \Exception('流水类型错误');
- }
- // if (!in_array($service_trans_prefer, ['DADA', 'SFTC'])) {
- // throw new \Exception('运力类型错误');
- // }
- $data = [
- 'wx_store_id' => $service->wx_store_id,
- 'flow_type' => $flow_type,
- 'service_trans_id' => $service_trans_prefer,
- 'begin_time' => time() - 3600 * 24 * 3,
- 'end_time' => time()
- ];
- $form = new IndexController();
- $form->store_id = $store_id;
- $result = $form->getUrlData($store_id, 'cgi-bin/express/intracity/queryflow', $data);
- if (isset($result['errcode']) && $result['errcode'] === 0) {
- foreach ($result['flow_list'] as $item) {
- if (in_array($item['flow_type'], [1, 3])) {
- $where = [
- 'pay_order_id' => $item['pay_order_id']
- ];
- } else {
- $where = [
- 'wx_order_id' => $item['wx_order_id']
- ];
- }
- $balance_log = WechatIntracityBalanceLog::findOne($where);
- if (!$balance_log) {
- $balance_log = new WechatIntracityBalanceLog();
- $balance_log->md_id = $md_id;
- $balance_log->flow_type = $item['flow_type'];
- if (isset($item['pay_order_id'])) {
- $balance_log->pay_order_id = $item['pay_order_id'];
- }
- $balance_log->service_trans_prefer = $item['service_trans_id'];
- $balance_log->pay_amount = sprintf('%.2f', ($item['pay_amount'] / 100));
- $balance_log->pay_time = $item['pay_time'];
- $balance_log->pay_status = $item['pay_status'];
- $balance_log->create_time = $item['create_time'];
- if (isset($item['consume_deadline'])) {
- $balance_log->consume_deadline = $item['consume_deadline'];
- }
- if (isset($item['refund_time'])) {
- $balance_log->refund_time = $item['refund_time'];
- }
- if (isset($item['refund_amount'])) {
- $balance_log->refund_amount = sprintf('%.2f', ($item['refund_amount'] / 100));
- }
- if (isset($item['refund_status'])) {
- $balance_log->refund_status = $item['refund_status'];
- }
- if (isset($item['deduct_amount'])) {
- $balance_log->deduct_amount = sprintf('%.2f', ($item['deduct_amount'] / 100));
- }
- if (isset($item['bill_id'])) {
- $balance_log->bill_id = $item['bill_id'];
- }
- if (isset($item['delivery_finished_time'])) {
- $balance_log->delivery_finished_time = $item['delivery_finished_time'];
- }
- if (isset($item['wx_order_id'])) {
- $balance_log->wx_order_id = $item['wx_order_id'];
- }
- if (isset($item['openid'])) {
- $balance_log->openid = $item['openid'];
- }
- if (isset($item['delivery_status'])) {
- $balance_log->delivery_status = $item['delivery_status'];
- }
- if (!$balance_log->save()) {
- throw new \Exception(json_encode($balance_log->errors, JSON_UNESCAPED_UNICODE));
- }
- }
- }
- if ($flow_type < 3) {
- $this->flow_type += 1;
- return $this->queryFlow();
- } else {
- return [
- 'code' => 0,
- 'msg' => '请求成功'
- ];
- }
- }
- throw new \Exception($result['errmsg'], $result['errcode']);
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- public function getStoreFundsList() {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- //获取余额信息
- $balance_result = $this->balanceQuery();
- $balance_list = [];
- if ($balance_result['code'] === 0) {
- $balance_list = $balance_result['data']['balance_list'];
- }
- return [
- 'code' => 0,
- 'msg' => '获取成功',
- 'data' => [
- 'balance_list' => $balance_list
- ]
- ];
- }
- public function getBalanceLog() {
- $store_id = $this->store_id;
- $md_id = $this->md_id;
- $service_trans_prefer = $this->service_trans_prefer;
- $flow_type = $this->flow_type;
- $begin_time = $this->begin_time;
- $end_time = $this->end_time;
- $query = WechatIntracityBalanceLog::find()->where(['md_id' => $md_id]);
- if (in_array($flow_type, [1, 2, 3])) {
- $query->andWhere(['flow_type' => $flow_type]);
- }
- if (in_array($service_trans_prefer, ['DADA', 'SFTC'])) {
- $query->andWhere(['service_trans_prefer' => $service_trans_prefer]);
- }
- if (!empty($begin_time)) {
- $start_time = strtotime($begin_time);
- $query->andWhere(['>=', 'create_time', $begin_time]);
- }
- if (!empty($end_time)) {
- $end_time = strtotime($end_time);
- $query->andWhere(['<=', 'create_time', $end_time]);
- }
- $query->orderBy('create_time');
- $pagination = pagination_make($query);
- foreach ($pagination['list'] as &$item) {
- $item['flow_type'] = (int)$item['flow_type'];
- $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : "";
- $item['create_time'] = $item['create_time'] > 0 ? date('Y-m-d H:i:s', $item['create_time']) : "";
- $item['consume_deadline'] = $item['consume_deadline'] > 0 ? date('Y-m-d H:i:s', $item['consume_deadline']) : "";
- $item['refund_time'] = $item['refund_time'] > 0 ? date('Y-m-d H:i:s', $item['refund_time']) : "";
- $item['delivery_finished_time'] = $item['delivery_finished_time'] > 0 ? date('Y-m-d H:i:s', $item['delivery_finished_time']) : "";
- $item['delivery_status'] = (int)$item['delivery_status'];
- }
- return [
- 'code' => 0,
- 'msg' => 'success',
- 'data' => [
- 'data' => $pagination['list'],
- 'pageNo' => $pagination['pageNo'],
- 'totalCount' => $pagination['totalCount'],
- ]
- ];
- }
- }
|