WechatTemplateMessageService.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <?php
  2. namespace ln\services;
  3. use app\common\repositories\store\order\StoreGroupOrderRepository;
  4. use app\common\repositories\store\order\StoreOrderRepository;
  5. use app\common\repositories\store\order\StoreOrderStatusRepository;
  6. use app\common\repositories\store\order\StoreRefundOrderRepository;
  7. use app\common\repositories\store\product\ProductGroupBuyingRepository;
  8. use app\common\repositories\store\product\ProductGroupUserRepository;
  9. use app\common\repositories\store\product\ProductRepository;
  10. use app\common\repositories\store\product\ProductTakeRepository;
  11. use app\common\repositories\store\service\StoreServiceRepository;
  12. use app\common\repositories\user\UserBillRepository;
  13. use app\common\repositories\user\UserExtractRepository;
  14. use app\common\repositories\user\UserRechargeRepository;
  15. use app\common\repositories\wechat\WechatUserRepository;
  16. use ln\listens\pay\UserRechargeSuccessListen;
  17. use ln\services\template\Template;
  18. use app\common\repositories\user\UserRepository;
  19. use think\facade\Route;
  20. class WechatTemplateMessageService
  21. {
  22. /**
  23. * TODO
  24. * @param array $data
  25. * @param string|null $link
  26. * @param string|null $color
  27. * @return bool
  28. * @author Qinii
  29. * @day 2020-06-29
  30. */
  31. public function sendTemplate(array $data)
  32. {
  33. $res = $this->templateMessage($data['tempCode'],$data['id']);
  34. if(!$res || !is_array($res))
  35. return true;
  36. foreach($res as $item){
  37. if(is_array($item['uid'])){
  38. foreach ($item['uid'] as $value){
  39. $openid = $this->getUserOpenID($value['uid']);
  40. if (!$openid) return true;
  41. $this->send($openid,$item['tempCode'],$item['data'],'wechat',$item['link'],$item['color']);
  42. }
  43. }else{
  44. $openid = $this->getUserOpenID($item['uid']);
  45. if (!$openid) return true;
  46. $this->send($openid,$item['tempCode'],$item['data'],'wechat',$item['link'],$item['color']);
  47. }
  48. }
  49. }
  50. /**
  51. * TODO
  52. * @param $data
  53. * @param string|null $link
  54. * @param string|null $color
  55. * @return bool
  56. * @author Qinii
  57. * @day 2020-07-01
  58. */
  59. public function subscribeSendTemplate($data)
  60. {
  61. $res = $this->subscribeTemplateMessage($data['tempCode'],$data['id']);
  62. if(!$res || !is_array($res))return true;
  63. foreach($res as $item){
  64. if(is_array($item['uid'])){
  65. foreach ($item['uid'] as $value){
  66. $openid = $this->getUserOpenID($value,'min');
  67. if (!$openid) return true;
  68. $this->send($openid,$item['tempCode'],$item['data'],'subscribe',$item['link'],$item['color']);
  69. }
  70. }else{
  71. $openid = $this->getUserOpenID($item['uid'],'min');
  72. if (!$openid) return true;
  73. $this->send($openid,$item['tempCode'],$item['data'],'subscribe',$item['link'],$item['color']);
  74. }
  75. }
  76. }
  77. /**
  78. * TODO
  79. * @param $uid
  80. * @return mixed
  81. * @author Qinii
  82. * @day 2020-06-29
  83. */
  84. public function getUserOpenID($uid,$type = 'wechat')
  85. {
  86. $user = app()->make(UserRepository::class)->get($uid);
  87. $make = app()->make(WechatUserRepository::class);
  88. if($type == 'wechat') {
  89. return $make->idByOpenId((int)$user['wechat_user_id']);
  90. }else{
  91. return $make->idByRoutineId((int)$user['wechat_user_id']);
  92. }
  93. }
  94. /**
  95. * TODO
  96. * @param $openid
  97. * @param $tempCode
  98. * @param $data
  99. * @param $type
  100. * @param $link
  101. * @param $color
  102. * @return bool|mixed
  103. * @author Qinii
  104. * @day 2020-07-01
  105. */
  106. public function send($openid,$tempCode,$data,$type,$link,$color)
  107. {
  108. try{
  109. $template = new Template($type);
  110. $template->to($openid)->color($color);
  111. if ($link) $template->url($link);
  112. return $template->send($tempCode, $data);
  113. } catch (\Exception $e) {
  114. return false;
  115. }
  116. }
  117. /**
  118. * TODO 公众号
  119. * @param string $tempCode
  120. * @param $id
  121. * @return array|bool
  122. * @author Qinii
  123. * @day 2020-07-01
  124. */
  125. public function templateMessage(string $tempCode, $id)
  126. {
  127. $bill_make = app()->make(UserBillRepository::class);
  128. $order_make = app()->make(StoreOrderRepository::class);
  129. $refund_make = app()->make(StoreRefundOrderRepository::class);
  130. $order_status_make = app()->make(StoreOrderStatusRepository::class);
  131. switch ($tempCode)
  132. {
  133. case 'ORDER_CREATE': //订单生成通知
  134. $res = $order_make->selectWhere(['group_order_id' => $id]);
  135. if(!$res) return false;
  136. foreach ($res as $item){
  137. $order = $order_make->getWith($item['order_id'],'orderProduct');
  138. $data[] = [
  139. 'tempCode' => 'ORDER_CREATE',
  140. 'uid' => app()->make(StoreServiceRepository::class)->getNoticeServiceInfo($item->mer_id),
  141. 'data' => [
  142. 'first' => '您有新的生成订单请注意查看',
  143. 'keyword1' => $item->create_time,
  144. 'keyword2' => '「'.$order['orderProduct'][0]['cart_info']['product']['store_name'].'」等',
  145. 'keyword3' => $item->order_sn,
  146. 'remark' => '查看详情'
  147. ],
  148. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/admin/orderList/index?types=1',
  149. 'color' => null
  150. ];
  151. }
  152. break;
  153. case 'ORDER_PAY_SUCCESS': //支付成功
  154. $group_order = app()->make(StoreGroupOrderRepository::class)->get($id);
  155. if(!$group_order) return false;
  156. $data[] = [
  157. 'tempCode' => 'ORDER_PAY_SUCCESS',
  158. 'uid' => $group_order->uid,
  159. 'data' => [
  160. 'first' => '您的订单已支付',
  161. 'keyword1' => $group_order->group_order_sn,
  162. 'keyword2' => $group_order->pay_price,
  163. 'remark' => '我们会经快发货,请耐心等待'
  164. ],
  165. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/users/order_list/index?status=1',
  166. 'color' => null
  167. ];
  168. $res = $order_make->selectWhere(['group_order_id' => $id]);
  169. if(!$res) return false;
  170. foreach ($res as $item){
  171. $data[] = [
  172. 'tempCode' => 'ORDER_PAY_SUCCESS',
  173. 'uid' => app()->make(StoreServiceRepository::class)->getNoticeServiceInfo($item->mer_id),
  174. 'data' => [
  175. 'first' => '您有新的支付订单请注意查看。',
  176. 'keyword1' => $item->order_sn,
  177. 'keyword2' => $item->pay_price,
  178. 'remark' => '请尽快发货。'
  179. ],
  180. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/admin/orderList/index?types=2',
  181. 'color' => null
  182. ];
  183. }
  184. break;
  185. case 'ORDER_POSTAGE_SUCCESS'://订单发货提醒(快递)
  186. $res = $order_make->get($id);
  187. if(!$res) return false;
  188. $data[] = [
  189. 'tempCode' => 'ORDER_POSTAGE_SUCCESS',
  190. 'uid' => $res->uid ,
  191. 'data' => [
  192. 'first' => '亲,宝贝已经启程了,好想快点来到你身边',
  193. 'keyword1' => $res['order_sn'],
  194. 'keyword2' => $res['delivery_name'],
  195. 'keyword3' => $res['delivery_id'],
  196. 'remark' => '请耐心等待收货哦。'
  197. ],
  198. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/order_details/index?order_id='.$id,
  199. 'color' => null
  200. ];
  201. break;
  202. case 'ORDER_DELIVER_SUCCESS'://订单发货提醒(送货)
  203. $res = $order_make->getWith($id,'orderProduct');
  204. if(!$res) return false;
  205. $data[] = [
  206. 'tempCode' => 'ORDER_DELIVER_SUCCESS',
  207. 'uid' => $res->uid ,
  208. 'data' => [
  209. 'first' => '亲,宝贝已经启程了,好想快点来到你身边',
  210. 'keyword1' => '「'.$res['orderProduct'][0]['cart_info']['product']['store_name'].'」等',
  211. 'keyword2' => $res['create_time'],
  212. 'keyword3' => $res['user_address'],
  213. 'keyword4' => $res['delivery_name'],
  214. 'keyword5' => $res['delivery_id'],
  215. 'remark' => '请耐心等待收货哦。'
  216. ],
  217. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/order_details/index?order_id='.$id,
  218. 'color' => null
  219. ];
  220. break;
  221. case 'ORDER_TAKE_SUCCESS': //订单收货通知
  222. $res = $order_make->getWith($id,'orderProduct');
  223. if(!$res) return false;
  224. $status = $order_status_make->getWhere(['order_id' => $id,'change_type' => 'take']);
  225. $data[] = [
  226. 'tempCode' => 'ORDER_TAKE_SUCCESS',
  227. 'uid' => $res->uid,
  228. 'data' => [
  229. 'first' => '亲,宝贝已经签收',
  230. 'keyword1' => $res['order_sn'],
  231. 'keyword2' => '已收货',
  232. 'keyword3' => $status['change_time'],
  233. 'keyword4' => '「'.$res['orderProduct'][0]['cart_info']['product']['store_name'].'」等',
  234. 'remark' => '请确认。'
  235. ],
  236. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/order_details/index?order_id='.$id,
  237. 'color' => null
  238. ];
  239. break;
  240. case 'USER_BALANCE_CHANGE'://帐户资金变动提醒
  241. $res = $bill_make->get($id);
  242. if(!$res) return false;
  243. $data[] = [
  244. 'tempCode' => 'USER_BALANCE_CHANGE',
  245. 'uid' => $res->uid,
  246. 'data' => [
  247. 'first' => '资金变动提醒',
  248. 'keyword1' => '账户余额变动',
  249. 'keyword2' => $res['number'],
  250. 'keyword3' => $res['create_time'],
  251. 'keyword4' => $res['balance'],
  252. 'remark' => '请确认'
  253. ],
  254. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/users/user_money/index',
  255. 'color' => null
  256. ];
  257. break;
  258. case 'ORDER_REFUND_STATUS'://退款申请通知
  259. $res = $refund_make->get($id);
  260. if(!$res) return false;
  261. $data[] = [
  262. 'tempCode' => 'ORDER_REFUND_STATUS',
  263. 'uid' => app()->make(StoreServiceRepository::class)->getNoticeServiceInfo($res->mer_id),
  264. 'data' => [
  265. 'first' => '您有新的退款申请',
  266. 'keyword1' => $res['refund_order_sn'],
  267. 'keyword2' => $res['refund_price'],
  268. 'keyword3' => $res['refund_message'],
  269. 'remark' => '请及时处理'
  270. ],
  271. 'link' => null,
  272. 'color' => null
  273. ];
  274. break;
  275. case 'ORDER_REFUND_END'://退货确认提醒
  276. $res = $refund_make->getWith($id,['order']);
  277. if(!$res) return false;
  278. $order = $order_make->getWith($res['order_id'],'orderProduct');
  279. $data[] = [
  280. 'tempCode' => 'ORDER_REFUND_END',
  281. 'uid' => $res->uid,
  282. 'data' => [
  283. 'first' => '亲,您有一个订单已退款',
  284. 'keyword1' => $res['refund_order_sn'],
  285. 'keyword2' => $res['order']['order_sn'],
  286. 'keyword3' => $res['refund_price'],
  287. 'keyword4' => '「'.$order['orderProduct'][0]['cart_info']['product']['store_name'].'」等',
  288. 'remark' => $order['activity_type'] == 4 ? '拼团失败,系统自动退款' : '请查看详情'
  289. ],
  290. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/users/refund/detail?id='.$id,
  291. 'color' => null
  292. ];
  293. break;
  294. case 'ORDER_REFUND_NOTICE'://退款进度提醒
  295. $status = [-1=>'审核未通过' ,1 => '商家已同意退货,请尽快将商品退回,并填写快递单号',];
  296. $res = $refund_make->getWith($id,['order']);
  297. if(!$res || !in_array($res['status'],[-1,1])) return false;
  298. $order = $order_make->getWith($res['order_id'],'orderProduct');
  299. $data[] = [
  300. 'tempCode' => 'ORDER_REFUND_NOTICE',
  301. 'uid' => $res->uid,
  302. 'data' => [
  303. 'first' => '退款进度提醒',
  304. 'keyword1' => $res['refund_order_sn'],
  305. 'keyword2' => $status[$res['status']],
  306. 'keyword3' => '「'.$order['orderProduct'][0]['cart_info']['product']['store_name'].'」等',
  307. 'keyword4' => $res['refund_price'],
  308. 'remark' => ''
  309. ],
  310. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/users/refund/detail?id='.$id,
  311. 'color' => null
  312. ];
  313. break;
  314. case 'GROUP_BUYING_SUCCESS':
  315. /*
  316. {{first.DATA}}
  317. 商品名称:{{keyword1.DATA}}
  318. 订单号:{{keyword2.DATA}}
  319. 支付金额:{{keyword3.DATA}}
  320. 支付时间:{{keyword4.DATA}}
  321. {{remark.DATA}}
  322. */
  323. $res = app()->make(ProductGroupBuyingRepository::class)->get($id);
  324. if(!$res) return false;
  325. $buying_make = app()->make(ProductGroupUserRepository::class);
  326. $ret = $buying_make->getSearch(['group_buying_id' => $id])->where('uid','>',0)->select();
  327. foreach ($ret as $item){
  328. $data[] = [
  329. 'tempCode' => 'GROUP_BUYING_SUCCESS',
  330. 'uid' => $item->uid,
  331. 'data' => [
  332. 'first' => '恭喜您拼团成功!',
  333. 'keyword1' => '「'.$res->productGroup->product['store_name'].'」',
  334. 'keyword2' => $item->orderInfo['order_sn'],
  335. 'keyword3' => $item->orderInfo['pay_price'],
  336. 'keyword4' => $item->orderInfo['pay_time'],
  337. 'remark' => ''
  338. ],
  339. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/order_details/index?order_id='.$item['order_id'],
  340. 'color' => null
  341. ];
  342. }
  343. break;
  344. case'PRODUCT_INCREASE':
  345. /*
  346. {{first.DATA}}
  347. 预订商品:{{keyword1.DATA}}
  348. 到货数量:{{keyword2.DATA}}
  349. 到货时间:{{keyword3.DATA}}
  350. {{remark.DATA}}
  351. */
  352. $make = app()->make(ProductTakeRepository::class);
  353. $product = app()->make(ProductRepository::class)->getWhere(['product_id' => $id],'*',['attrValue']);
  354. if(!$product) return false;
  355. $unique[] = 1;
  356. foreach ($product['attrValue'] as $item) {
  357. if($item['stock'] > 0){
  358. $unique[] = $item['unique'];
  359. }
  360. }
  361. $query = $make->getSearch(['product_id' => $id,'status' =>0,'type' => 2])->where('unique','in',$unique);
  362. $uid = $query->column('uid,product_id');
  363. if(!$uid) return false;
  364. $tak_id = $query->column('product_take_id');
  365. app()->make(ProductTakeRepository::class)->updates($tak_id,['status' => 1]);
  366. $data[] = [
  367. 'tempCode' => 'PRODUCT_INCREASE',
  368. 'uid' => $uid,
  369. 'data' => [
  370. 'first' => '亲,你想要的商品已到货,可以购买啦~',
  371. 'keyword1' => '「'.$product->store_name.'」',
  372. 'keyword2' => $product->stock,
  373. 'keyword3' => date('Y-m-d H:i:s',time()),
  374. 'remark' => ''
  375. ],
  376. 'link' => rtrim(systemConfig('site_url'),'/').'/pages/goods_details/index?id='.$id,
  377. 'color' => null
  378. ];
  379. break;
  380. default:
  381. return false;
  382. break;
  383. }
  384. return $data;
  385. }
  386. /**
  387. * TODO 小程序模板
  388. * @param string $tempCode
  389. * @param $id
  390. * @return array|bool
  391. * @author Qinii
  392. * @day 2020-07-01
  393. */
  394. public function subscribeTemplateMessage(string $tempCode, $id)
  395. {
  396. $user_make = app()->make(UserRechargeRepository::class);
  397. $order_make = app()->make(StoreOrderRepository::class);
  398. $refund_make = app()->make(StoreRefundOrderRepository::class);
  399. $order_group_make = app()->make(StoreGroupOrderRepository::class);
  400. $extract_make = app()->make(UserExtractRepository::class);
  401. switch($tempCode)
  402. {
  403. case 'ORDER_PAY_SUCCESS': //订单支付成功
  404. $res = $order_group_make->get($id);
  405. if(!$res) return false;
  406. $data[] = [
  407. 'tempCode' => 'ORDER_PAY_SUCCESS',
  408. 'uid' => $res->uid,
  409. 'data' => [
  410. 'character_string1' => $res->group_order_sn,
  411. 'amount2' => $res->pay_price,
  412. 'date3' => $res->pay_time,
  413. 'amount5' => $res->total_price,
  414. ],
  415. 'link' => 'pages/users/order_list/index?status=1',
  416. 'color' => null
  417. ];
  418. break;
  419. case 'ORDER_DELIVER_SUCCESS': //订单发货提醒(送货)
  420. $res = $order_make->getWith($id,'orderProduct');
  421. if(!$res) return false;
  422. $name = substr($res['orderProduct'][0]['cart_info']['product']['store_name'],0,10);
  423. $data[] = [
  424. 'tempCode' => 'ORDER_DELIVER_SUCCESS',
  425. 'uid' => $res->uid,
  426. 'data' => [
  427. 'thing8' => '「'.$name.'」等',
  428. 'character_string1' => $res->order_sn,
  429. 'name4' => $res->delivery_name,
  430. 'phone_number10' => $res->delivery_id,
  431. ],
  432. 'link' => 'pages/order_details/index?order_id='.$id,
  433. 'color' => null
  434. ];
  435. break;
  436. case 'ORDER_POSTAGE_SUCCESS': //订单发货提醒(快递)
  437. $res = $order_make->getWith($id,'orderProduct');
  438. if(!$res) return false;
  439. $name = substr($res['orderProduct'][0]['cart_info']['product']['store_name'],0,10);
  440. $data[] = [
  441. 'tempCode' => 'ORDER_POSTAGE_SUCCESS',
  442. 'uid' => $res->uid,
  443. /**
  444. 快递单号{{character_string2.DATA}}
  445. 快递公司{{thing1.DATA}}
  446. 发货时间{{time3.DATA}}
  447. 订单商品{{thing5.DATA}}
  448. */
  449. 'data' => [
  450. 'character_string2' => $res->delivery_id,
  451. 'thing1' => $res->delivery_name,
  452. 'time3' => date('Y-m-d H:i:s',time()),
  453. 'thing5' => '「'.$name.'」等',
  454. ],
  455. 'link' => 'pages/order_details/index?order_id='.$id,
  456. 'color' => null
  457. ];
  458. break;
  459. case 'ORDER_REFUND_NOTICE': //退款通知
  460. $status = [-1=>'审核未通过' ,1 => '商家已同意退货,请尽快将商品退回',3 => '退款成功'];
  461. $res = $refund_make->getWith($id,['order']);
  462. if(!$res || !in_array($res['status'],[-1,1,3])) return false;
  463. $order = $order_make->getWith($res['order_id'],'orderProduct');
  464. $name = substr($order['orderProduct'][0]['cart_info']['product']['store_name'],0,10);
  465. $data[] = [
  466. 'tempCode' => 'ORDER_REFUND_NOTICE',
  467. 'uid' => $res->uid,
  468. 'data' => [
  469. 'thing1' => $status[$res->status],
  470. 'thing2' => '「'.$name.'」等',
  471. 'character_string6' => $res->refund_order_sn,
  472. 'amount3' => $res->refund_price,
  473. 'thing13' => $res->fail_message ?? '',
  474. ],
  475. 'link' => 'pages/users/refund/detail?id='.$id,
  476. 'color' => null
  477. ];
  478. break;
  479. case 'RECHARGE_SUCCESS': //充值成功
  480. $res = $user_make->get($id);
  481. if(!$res) return false;
  482. $data[] = [
  483. 'tempCode' => 'RECHARGE_SUCCESS',
  484. 'uid' => $res->uid,
  485. 'data' => [
  486. 'character_string1' => $res->order_id,
  487. 'amount3' => $res->price,
  488. 'amount6' => $res->give_price,
  489. 'date5' => $res->pay_time,
  490. ],
  491. 'link' => 'pages/users/user_money/index',
  492. 'color' => null
  493. ];
  494. break;
  495. case 'USER_EXTRACT': //提现结果通知
  496. $res = $extract_make->get($id);
  497. if(!$res) return false;
  498. $data[] = [
  499. 'tempCode' => 'USER_EXTRACT',
  500. 'uid' => $res->uid,
  501. 'data' => [
  502. 'thing1' => $res->status == -1 ? '未通过' : '已通过',
  503. 'amount2' => empty($res->bank_code)?(empty($res->alipay_code)?$res->wechat:$res->alipay_code):$res->bank_code,
  504. 'thing3' => $res->give_price,
  505. 'date4' => $res->create_time,
  506. ],
  507. 'link' => 'pages/users/user_spread_user/index',
  508. 'color' => null
  509. ];
  510. break;
  511. case'PRODUCT_INCREASE':
  512. /*
  513. 商品名称 {{thing1.DATA}}
  514. 商品价格:{{amount5.DATA}}
  515. 温馨提示:{{thing2.DATA}}
  516. */
  517. $make = app()->make(ProductTakeRepository::class);
  518. $product = app()->make(ProductRepository::class)->getWhere(['product_id' => $id],'*',['attrValue']);
  519. if(!$product) return false;
  520. $unique[] = 1;
  521. foreach ($product['attrValue'] as $item) {
  522. if($item['stock'] > 0){
  523. $unique[] = $item['unique'];
  524. }
  525. }
  526. $query = $make->getSearch(['product_id' => $id,'status' =>0,'type' => 3])->where('unique','in',$unique);
  527. $uid = $query->column('uid');
  528. if(!$uid) return false;
  529. $tak_id = $query->column('product_take_id');
  530. app()->make(ProductTakeRepository::class)->updates($tak_id,['status' => 1]);
  531. $data[] = [
  532. 'tempCode' => 'PRODUCT_INCREASE',
  533. 'uid' => $uid,
  534. 'data' => [
  535. 'thing1' => '「'.substr($product->store_name,0,10) .'」',
  536. 'amount5' => $product->price,
  537. 'thing2' => '亲!你想要的商品已到货,可以购买啦~',
  538. ],
  539. 'link' => 'pages/goods_details/index?id='.$id,
  540. 'color' => null
  541. ];
  542. break;
  543. default:
  544. return false;
  545. break;
  546. }
  547. return $data;
  548. }
  549. }