Order.php 22 KB

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