Order.php 23 KB

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