Order.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\api\controller;
  13. use app\api\model\Order as OrderModel;
  14. use app\api\model\Setting as SettingModel;
  15. use app\api\model\Express as ExpressModel;
  16. use app\api\model\Receipt as ReceiptModel;
  17. use app\api\model\shop\Shops;
  18. use app\common\enum\order\DeliveryType;
  19. use app\common\enum\order\PayType as OrderPayTypeEnum;
  20. use app\common\enum\order\DeliveryStatus as DeliveryStatusEnum;
  21. use app\common\exception\BaseException;
  22. use app\api\service\order\Order as OrderService;
  23. use app\api\model\OrderGoods;
  24. use app\common\library\helper;
  25. use app\common\model\card\UserRiceDeliveryExpress as UserRiceDeliveryExpressModel;
  26. use app\common\model\card\UserRiceDelivery as UserRiceDeliveryModel;
  27. use app\api\service\User as UserService;
  28. use app\common\model\RefundCompensate;
  29. use app\common\model\OrderTj;
  30. use app\common\model\SmsRemind;
  31. use app\common\model\PushLog;
  32. use app\console\service\WxDelivery;
  33. use app\store\model\ChannelSaleVolumeTj;
  34. use app\store\model\user\CommerCountTj;
  35. use think\cache\driver\Redis;
  36. use app\common\model\member\MemberTj;
  37. use think\facade\Db;
  38. use think\facade\Log;
  39. /**
  40. * 我的订单控制器
  41. * Class Order
  42. * @package app\api\controller
  43. */
  44. class Order extends Controller
  45. {
  46. public function tj(){
  47. $now = time();
  48. //推荐官销售数据统计
  49. $commerTj = new CommerCountTj();
  50. $commerTj->day($now);
  51. $commerTj->week($now);
  52. $commerTj->month($now);
  53. echo 'success commer'.PHP_EOL;
  54. //全渠道销售业绩构成
  55. $csvTj = new ChannelSaleVolumeTj();
  56. $csvTj->day($now);
  57. $csvTj->week($now);
  58. $csvTj->month($now);
  59. echo 'success order'.PHP_EOL;
  60. $otj = new OrderTj;
  61. $day = $otj->day(1);
  62. $month = $otj->month();
  63. $week = $otj->week();
  64. echo 'success order <br/>';
  65. $otjmember = new MemberTj;
  66. $otjmember->day(1);
  67. $otjmember->month();
  68. $otjmember->week();
  69. echo 'success member';
  70. }
  71. //给订单打新老用户tag
  72. public function ordertag(){
  73. $sql = 'select order_id,user_id from yoshop_order where pay_status=20 and tag=-1 limit 100';
  74. $result = Db::query($sql);
  75. foreach($result as $row){
  76. $user_id = $row['user_id'];
  77. $small = "select min(order_id) as min_order_id from yoshop_order where pay_status=20 and user_id=".$user_id;
  78. $s = Db::query($small);
  79. if($s[0]['min_order_id']==$row['order_id']){
  80. OrderModel::where('order_id',$row['order_id'])->update(['tag'=>1]);
  81. }else{
  82. OrderModel::where('order_id',$row['order_id'])->update(['tag'=>0]);
  83. }
  84. }
  85. echo 'success order tag';
  86. }
  87. public function smsremind(){
  88. $sms = SmsRemind::where('id','>',0)->find();
  89. if($sms->hours){
  90. $hours = $sms->hours;
  91. $hours_arr = explode(",",$hours);
  92. $now_hour = Date("H",time());
  93. if(in_array($now_hour,$hours_arr)){
  94. $filter['pay_status'] =20;
  95. $filter['delivery_status'] = 10;//未发货
  96. $filter['order_status'] = 10;//进行中
  97. $filter['delivery_type'] = 10;// 快递配送单
  98. $c = OrderModel::where($filter)->count();
  99. if($c>0){
  100. $mobiles = $sms->mobiles;
  101. $key = "sms remind".Date("YmdH",time());
  102. $rds = new Redis(config('cache.stores.redis'));
  103. $value = $rds->get($key);
  104. if($value){
  105. echo 'sms have send';
  106. }else{
  107. $rds->set($key,1,3600);
  108. $content = '您有'.$c.'个订单待发货,请及时处理!['.substr(Date("Y-m-d",time()),2)." ".$now_hour.":00".']';
  109. // var_dump($content);
  110. PushLog::addSmsMon($content,$mobiles,1);
  111. echo 'remind order success'.$content.',mobile:'.$sms->mobiles;
  112. }
  113. }else{
  114. echo 'no order remind';
  115. }
  116. }else{
  117. echo 'no the time now ';
  118. }
  119. }
  120. //每小时给订单打个新老用户的标签
  121. $this->ordertag();
  122. }
  123. /**
  124. * 获取当前用户待处理的订单数量
  125. * @return array|\think\response\Json
  126. * @throws BaseException
  127. */
  128. public function todoCounts()
  129. {
  130. $model = new OrderModel;
  131. $counts = $model->getTodoCounts();
  132. return $this->renderSuccess(compact('counts'));
  133. }
  134. /**
  135. * 订单商品详情
  136. * @param int $orderGoodsId 订单商品ID
  137. * @return \app\common\model\OrderGoods|null
  138. * @throws BaseException
  139. */
  140. public function refundGoods(int $order_goods_id)
  141. {
  142. $goods = OrderGoods::detail($order_goods_id);
  143. unset($goods['content']);
  144. return $this->renderSuccess(compact('goods'));
  145. }
  146. /**
  147. * 我的订单列表
  148. * @param string $dataType 订单类型 (all全部 payment待付款 received待发货 deliver待收货 completed已完成 comment待评价)
  149. * @return array|\think\response\Json
  150. * @throws BaseException
  151. * @throws \think\db\exception\DbException
  152. */
  153. public function list(string $dataType)
  154. {
  155. $isExchange = boolval($this->request->param('isExchange',0));
  156. $model = new OrderModel;
  157. $list = $model->getList($dataType,$isExchange);
  158. $orderService = new OrderService;
  159. //获取多个物流的最新信息
  160. $orderService->setUserOrder($list);
  161. return $this->renderSuccess(compact('list'));
  162. }
  163. /**
  164. * 订单详情信息
  165. * @param int $orderId 订单ID
  166. * @return array|\think\response\Json
  167. * @throws BaseException
  168. * @throws \think\db\exception\DataNotFoundException
  169. * @throws \think\db\exception\DbException
  170. * @throws \think\db\exception\ModelNotFoundException
  171. */
  172. public function detail(int $orderId)
  173. {
  174. // 订单详情
  175. $model = OrderModel::getUserOrderDetail($orderId);
  176. $ExpressModel = new ExpressModel;
  177. $express = [];
  178. $i = 0;
  179. if($model['delivery_status']==DeliveryStatusEnum::DELIVERED){//订单状态没有更改为已发货就不显示物流信息
  180. foreach ($model['goods'] as &$good){
  181. $refundCompensate = RefundCompensate::where('order_goods_id',$good['order_goods_id'])->where("finance_refund",10)->where("status",20)->find();
  182. if($refundCompensate){
  183. $good['compensate'] = ['refund_money'=>$refundCompensate->refund_money];
  184. }else{
  185. $good['compensate'] =null;
  186. }
  187. if($good['is_split_package']){
  188. foreach ($good['package'] as $pack){
  189. $express[$i] = $ExpressModel->deliverylist($pack['express_no'], $pack['delivery_time'], 2);
  190. $express[$i]['express_no'] = $pack['express_no'];
  191. $i++;
  192. }
  193. }else{
  194. if($good['express_no']){
  195. $express[$i] = $ExpressModel->deliverylist($good['express_no'], $good['delivery_time'], 2);
  196. $express[$i]['express_no'] = $good['express_no'];
  197. $i++;
  198. }
  199. }
  200. }
  201. }
  202. $model['express_list'] = $express;
  203. $express_no_list = array_values(array_filter(array_unique(helper::getArrayColumn($express, 'express_no'))));
  204. $model['express_no'] = implode(',',$express_no_list);
  205. OrderModel::restructureGoods($model);
  206. $model['has_receipt'] = ReceiptModel::ifApplyReceipt($orderId);
  207. $model['hx_qrcode_url'] = url('/api/order/getHxQrcode',['hxCode'=>$model['hx_code']], true, true)->build();
  208. if($model['delivery_type']==DeliveryType::SHOPS_DELIVERY){
  209. $model['shops'] = Shops::find($model['shop_id']);
  210. }
  211. return $this->renderSuccess([
  212. 'order' => $model, // 订单详情
  213. 'setting' => [
  214. // 积分名称
  215. 'points_name' => SettingModel::getPointsName(),
  216. ],
  217. ]);
  218. }
  219. /**
  220. * 检查订单核销状态
  221. */
  222. public function checkHxStatus(int $orderId)
  223. {
  224. // 订单详情
  225. $model = OrderModel::getDetail($orderId);
  226. if (empty($model)) {
  227. return $this->renderError("订单不存在");
  228. }
  229. $hx_status = $model['hx_status'];
  230. return $this->renderSuccess(compact('hx_status'));
  231. }
  232. /**
  233. * 核销码二维码地址
  234. */
  235. public function getHxQrcode(string $hxCode) {
  236. return OrderService::getHxQrcode($hxCode);
  237. }
  238. /**
  239. * 自制异业福利券核销码二维码地址
  240. */
  241. public function getHxWelQrcode($id) {
  242. return OrderService::getHxQrcode($id);
  243. }
  244. /**
  245. * 查看物流列表
  246. * @param int $orderId 订单ID
  247. * @return array|\think\response\Json
  248. * @throws BaseException
  249. * @throws \think\db\exception\DataNotFoundException
  250. * @throws \think\db\exception\DbException
  251. * @throws \think\db\exception\ModelNotFoundException
  252. */
  253. public function expressList(int $orderId)
  254. {
  255. // 订单信息
  256. $order = OrderModel::getDetail($orderId, ['goods' => ['image', 'package'], 'address']);
  257. if (!$order || $order['delivery_status']!=DeliveryStatusEnum::DELIVERED) {
  258. return $this->renderError('没有物流信息');
  259. }
  260. $orderService = new OrderService;
  261. //获取多个物流的最新信息
  262. $res = $orderService->getExpressList($order);
  263. return $this->renderSuccess($res);
  264. }
  265. /**
  266. * 查看物流详情
  267. * @param $orderId
  268. * @param $expressNo
  269. * @return array
  270. * @throws BaseException
  271. * @throws \think\db\exception\DataNotFoundException
  272. * @throws \think\db\exception\DbException
  273. * @throws \think\db\exception\ModelNotFoundException
  274. * @author: zjwhust
  275. * @Time: 2021/10/9 9:13
  276. */
  277. public function express($orderId, $expressNo)
  278. {
  279. // 订单信息
  280. $order = OrderModel::getDetail(intval($orderId), ['goods' => ['image', 'package'], 'address']);
  281. if (!$order || $order['delivery_status']!=DeliveryStatusEnum::DELIVERED) {
  282. return $this->renderError('没有物流信息');
  283. }
  284. $orderService = new OrderService;
  285. //获取多个物流的最新信息
  286. $res = $orderService->getExpressDetail($order, $expressNo);
  287. return $this->renderSuccess($res);
  288. }
  289. //获取物流的最新信息
  290. public function rcexpress($express_no){
  291. $orderService = new OrderService;
  292. $express = UserRiceDeliveryExpressModel::field('express_no,express_id,express_company,user_rice_delivery_id,delivery_time')->where("express_no",$express_no)->find();
  293. if(empty($express)){
  294. return $this->renderError("物流单号找不到");
  295. }
  296. $delivery_time = $express['delivery_time']??'';
  297. $delivery = UserRiceDeliveryModel::where('id',$express->user_rice_delivery_id)->find();
  298. $data = $orderService->getExpressInfo($express_no,$delivery_time);
  299. return $this->renderSuccess(['data'=>$data,'express'=>$express,'delivery'=>$delivery]);
  300. }
  301. /**
  302. * 取消订单
  303. * @param int $orderId
  304. * @return array|\think\response\Json
  305. * @throws BaseException
  306. */
  307. public function cancel(int $orderId)
  308. {
  309. $model = OrderModel::getDetail($orderId);
  310. if ($model->cancel()) {
  311. return $this->renderSuccess('订单取消成功');
  312. }
  313. return $this->renderError($model->getError() ?: '订单取消失败');
  314. }
  315. /**
  316. * 删除订单
  317. * @param int $orderId
  318. * @return array|\think\response\Json
  319. * @throws BaseException
  320. */
  321. public function delete(int $orderId)
  322. {
  323. $model = OrderModel::getDetail($orderId);
  324. if ($model->clear()) {
  325. return $this->renderSuccess('订单删除成功');
  326. }
  327. return $this->renderError($model->getError() ?: '订单删除失败');
  328. }
  329. /**
  330. * 确认收货
  331. * @param int $orderId
  332. * @return array|\think\response\Json
  333. * @throws BaseException
  334. */
  335. public function receipt(int $orderId)
  336. {
  337. $model = OrderModel::getDetail($orderId);
  338. if ($model->receipt()) {
  339. // //分佣结算逻辑
  340. // $cm = new GiveOutCommission();
  341. // $flag = $cm->confirmGoodsCommission($orderId);
  342. // if ($flag == false){
  343. // log_record('订单分佣结算失败:'.$orderId);
  344. // }
  345. // //order_goods的财务结算状态变更
  346. // OrderGoods::where('order_id',$orderId)->update(['finance_clearing_status'=>OrderGoods::FINANCE_CLEARING_WAIT]);
  347. return $this->renderSuccess('确认收货成功');
  348. }
  349. return $this->renderError($model->getError());
  350. }
  351. /**
  352. * 立即支付
  353. * @param int $orderId 订单ID
  354. * @param int $payType 支付方式
  355. * @return array|\think\response\Json
  356. * @throws BaseException
  357. * @throws \think\db\exception\DataNotFoundException
  358. * @throws \think\db\exception\DbException
  359. * @throws \think\db\exception\ModelNotFoundException
  360. */
  361. public function pay(int $orderId, int $payType = OrderPayTypeEnum::WECHAT)
  362. {
  363. // 获取订单详情
  364. $model = OrderModel::getUserOrderDetail($orderId);
  365. // 订单支付事件
  366. if (!$model->onPay($payType)) {
  367. return $this->renderError($model->getError() ?: '订单支付失败');
  368. }
  369. // 构建微信支付请求
  370. $payment = $model->onOrderPayment($model, $payType);
  371. // 支付状态提醒
  372. return $this->renderSuccess([
  373. 'order_id' => $model['order_id'], // 订单id
  374. 'pay_type' => $payType, // 支付方式
  375. 'payment' => $payment // 微信支付参数
  376. ]);
  377. }
  378. //统计rf
  379. public function rf(){
  380. $r1f1 = "select user_id,count(order_id) as c from yoshop_order
  381. where pay_status=20
  382. and pay_time>unix_timestamp(now())-7*86400
  383. GROUP BY user_id HAVING count(order_id)=1";
  384. $r1f2 = "select user_id,count(order_id) as c from yoshop_order
  385. where pay_status=20
  386. and pay_time>unix_timestamp(now())-7*86400
  387. GROUP BY user_id HAVING count(order_id)>=2 and count(order_id)<5";
  388. $r1f3 = "select user_id,count(order_id) as c from yoshop_order
  389. where pay_status=20
  390. and pay_time>unix_timestamp(now())-7*86400
  391. GROUP BY user_id HAVING count(order_id)>=5";
  392. $r2f1 = "select user_id,count(order_id) as c from yoshop_order
  393. where pay_status=20
  394. and pay_time<unix_timestamp(now())-7*86400
  395. and pay_time>unix_timestamp(now())-60*86400
  396. GROUP BY user_id HAVING count(order_id)=1";
  397. $r2f2 = "select user_id,count(order_id) as c from yoshop_order
  398. where pay_status=20
  399. and pay_time<unix_timestamp(now())-7*86400
  400. and pay_time>unix_timestamp(now())-60*86400
  401. GROUP BY user_id HAVING count(order_id)>=2 and count(order_id)<5";
  402. $r2f3 = "select user_id,count(order_id) as c from yoshop_order
  403. where pay_status=20
  404. and pay_time<unix_timestamp(now())-7*86400
  405. and pay_time>unix_timestamp(now())-60*86400
  406. GROUP BY user_id HAVING count(order_id)>=5";
  407. $r3f1 = "select user_id,count(order_id) as c from yoshop_order
  408. where pay_status=20
  409. and pay_time<unix_timestamp(now())-60*86400
  410. GROUP BY user_id HAVING count(order_id)=1";
  411. $r3f2 = "select user_id,count(order_id) as c from yoshop_order
  412. where pay_status=20
  413. and pay_time<unix_timestamp(now())-60*86400
  414. GROUP BY user_id HAVING count(order_id)>=2 and count(order_id)<5";
  415. $r3f3 = "select user_id,count(order_id) as c from yoshop_order
  416. where pay_status=20
  417. and pay_time<unix_timestamp(now())-60*86400
  418. GROUP BY user_id HAVING count(order_id)>=5";
  419. $result11 = Db::query($r1f1);
  420. $result12 = Db::query($r1f2);
  421. $result13 = Db::query($r1f3);
  422. $result21 = Db::query($r2f1);
  423. $result22 = Db::query($r2f2);
  424. $result23 = Db::query($r2f3);
  425. $result31 = Db::query($r3f1);
  426. $result32 = Db::query($r3f2);
  427. $result33 = Db::query($r3f3);
  428. // var_dump(count($result11));
  429. // var_dump(count($result12));
  430. // var_dump(count($result13));
  431. $r11 = count($result11);
  432. $r12 = count($result12);
  433. $r13 = count($result13);
  434. $r21 = count($result21);
  435. $r22 = count($result22);
  436. $r23 = count($result23);
  437. // var_dump(count($result21));
  438. // var_dump(count($result22));
  439. // var_dump(count($result23));
  440. // var_dump(count($result31));
  441. // var_dump(count($result32));
  442. // var_dump(count($result33));
  443. $r31 = count($result31);
  444. $r32 = count($result32);
  445. $r33 = count($result33);
  446. $data[] = ['r11'=>$r11,"r12"=>$r12,"r13"=>$r13,'r1'=>$r11+$r12+$r13];
  447. $data[] = ['r21'=>$r21,"r22"=>$r22,"r23"=>$r23,'r2'=>$r21+$r22+$r23];
  448. $data[] = ['r31'=>$r31,"r32"=>$r32,"r33"=>$r33,'r3'=>$r31+$r32+$r33];
  449. return $this->renderSuccess(compact('data'));
  450. }
  451. //统计rm
  452. public function rm(){
  453. $r1f1 = "select user_id,sum(pay_price+rice_card_money) from yoshop_order
  454. where pay_status=20
  455. and pay_time>unix_timestamp(now())-7*86400
  456. GROUP BY user_id HAVING sum(pay_price+rice_card_money)<200";
  457. $r1f2 = "select user_id,count(order_id) as c from yoshop_order
  458. where pay_status=20
  459. and pay_time>unix_timestamp(now())-7*86400
  460. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=200 and sum(pay_price+rice_card_money)<1000";
  461. $r1f3 = "select user_id,count(order_id) as c from yoshop_order
  462. where pay_status=20
  463. and pay_time>unix_timestamp(now())-7*86400
  464. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=1000";
  465. $r2f1 = "select user_id,sum(pay_price+rice_card_money) from yoshop_order
  466. where pay_status=20
  467. and pay_time>unix_timestamp(now())-60*86400
  468. and pay_time<unix_timestamp(now())-7*86400
  469. GROUP BY user_id HAVING sum(pay_price+rice_card_money)<200";
  470. $r2f2 ="select user_id,sum(pay_price+rice_card_money) from yoshop_order
  471. where pay_status=20
  472. and pay_time>unix_timestamp(now())-60*86400
  473. and pay_time<unix_timestamp(now())-7*86400
  474. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=200 and sum(pay_price+rice_card_money)<1000";
  475. $r2f3 = "select user_id,sum(pay_price+rice_card_money) from yoshop_order
  476. where pay_status=20
  477. and pay_time>unix_timestamp(now())-60*86400
  478. and pay_time<unix_timestamp(now())-7*86400
  479. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=1000";
  480. $r3f1 = "select user_id,sum(pay_price+rice_card_money) from yoshop_order
  481. where pay_status=20
  482. and pay_time<unix_timestamp(now())-60*86400
  483. GROUP BY user_id HAVING sum(pay_price+rice_card_money)<200";
  484. $r3f2 ="select user_id,sum(pay_price+rice_card_money) from yoshop_order
  485. where pay_status=20
  486. and pay_time<unix_timestamp(now())-60*86400
  487. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=200 and sum(pay_price+rice_card_money)<1000";
  488. $r3f3 = "select user_id,sum(pay_price+rice_card_money) from yoshop_order
  489. where pay_status=20
  490. and pay_time<unix_timestamp(now())-60*86400
  491. GROUP BY user_id HAVING sum(pay_price+rice_card_money)>=1000";
  492. $result11 = Db::query($r1f1);
  493. $result12 = Db::query($r1f2);
  494. $result13 = Db::query($r1f3);
  495. $result21 = Db::query($r2f1);
  496. $result22 = Db::query($r2f2);
  497. $result23 = Db::query($r2f3);
  498. $result31 = Db::query($r3f1);
  499. $result32 = Db::query($r3f2);
  500. $result33 = Db::query($r3f3);
  501. // var_dump(count($result11));
  502. // var_dump(count($result12));
  503. // var_dump(count($result13));
  504. $r11 = count($result11);
  505. $r12 = count($result12);
  506. $r13 = count($result13);
  507. $r21 = count($result21);
  508. $r22 = count($result22);
  509. $r23 = count($result23);
  510. // var_dump(count($result21));
  511. // var_dump(count($result22));
  512. // var_dump(count($result23));
  513. // var_dump(count($result31));
  514. // var_dump(count($result32));
  515. // var_dump(count($result33));
  516. $r31 = count($result31);
  517. $r32 = count($result32);
  518. $r33 = count($result33);
  519. $data[] = ['r11'=>$r11,"r12"=>$r12,"r13"=>$r13,'r1'=>$r11+$r12+$r13];
  520. $data[] = ['r21'=>$r21,"r22"=>$r22,"r23"=>$r23,'r2'=>$r21+$r22+$r23];
  521. $data[] = ['r31'=>$r31,"r32"=>$r32,"r33"=>$r33,'r3'=>$r31+$r32+$r33];
  522. return $this->renderSuccess(compact('data'));
  523. }
  524. //用户将系统中已手动发货的订单录入到微信小程序发货系统
  525. //20 * * * * webuser curl https://wxapp.rwgmlc.cn/api/order/wx_delivery_cron
  526. public function wxDeliveryCron(){
  527. Log::info('wxDeliveryCroning');
  528. $wxDeliveryServ = new WxDelivery();
  529. $wxDeliveryServ->pullOrderStatus(10001);
  530. return $this->renderSuccess([]);
  531. }
  532. }