SubscriptionActionEnum.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <?php
  2. namespace addons\TinyShop\common\enums;
  3. use common\enums\BaseEnum;
  4. use addons\TinyShop\common\models\marketing\CouponType;
  5. use addons\TinyShop\common\models\order\AfterSale;
  6. use addons\TinyShop\common\models\order\Order;
  7. use addons\TinyShop\common\models\order\OrderProduct;
  8. /**
  9. * 提醒方法
  10. *
  11. * Class SubscriptionActionEnum
  12. * @package addons\TinyShop\common\enums
  13. * @author jianyan74 <751393839@qq.com>
  14. */
  15. class SubscriptionActionEnum extends BaseEnum
  16. {
  17. const MESSAGE = 'message';
  18. const ANNOUNCE = 'announce';
  19. /** @var string 订单提醒 */
  20. const ORDER_CONSIGN = 'order_consign';
  21. const ORDER_RECEIVING = 'order_receiving';
  22. const ORDER_PAY = 'order_pay';
  23. const ORDER_CANCEL = 'order_cancel';
  24. const ORDER_AFTER_SALE_APPLY = 'order_after_sale_apply';
  25. const ORDER_STOCK_UP_ACCOMPLISH = 'order_stock_up_accomplish';
  26. const ORDER_RETURN_MONEY = 'order_return_money';
  27. const ORDER_RETURN_MEMBER_DELIVER = 'order_return_member_deliver';
  28. const ORDER_RETURN_APPLY_CLOSE = 'order_return_apply_close';
  29. const ORDER_WHOLESALE_OPEN = 'order_wholesale_open';
  30. const ORDER_WHOLESALE_JOIN = 'order_wholesale_join';
  31. const ORDER_WHOLESALE_ACCOMPLISH = 'order_wholesale_accomplish';
  32. const ORDER_WHOLESALE_CLOSE = 'order_wholesale_close';
  33. const ORDER_BARGAIN_FRIEND_JOIN = 'order_bargain_friend_join';
  34. const ORDER_BARGAIN_ACCOMPLISH = 'order_bargain_accomplish';
  35. const ORDER_BARGAIN_CLOSE = 'order_bargain_close';
  36. const ORDER_VIRTUAL = 'order_virtual';
  37. /** @var string 优惠券提醒 */
  38. const COUPON_GIVE = 'coupon_give';
  39. const COUPON_CLOSE = 'coupon_close';
  40. /** @var string 佣金提醒 */
  41. const COMMISSION = 'commission';
  42. /** @var string 骑手 */
  43. const ORDER_CABALLERO_RECEIVING = 'order_caballero_receiving';
  44. const ORDER_CABALLERO_CANCEL = 'order_caballero_cancel';
  45. const INVOICE_APPLY = 'invoice_apply';
  46. const OPINION_CREATE = 'opinion_create';
  47. /**
  48. * @return array
  49. */
  50. public static function getMap(): array
  51. {
  52. return [
  53. self::ANNOUNCE => '公告提醒',
  54. self::MESSAGE => '私信提醒',
  55. self::ORDER_CONSIGN => '订单发货',
  56. self::ORDER_CANCEL => '订单退单',
  57. self::ORDER_RECEIVING => '商家已接单',
  58. self::ORDER_CABALLERO_RECEIVING => '骑手已接单',
  59. self::ORDER_CABALLERO_CANCEL => '骑手已取消',
  60. self::ORDER_PAY => '新订单',
  61. self::ORDER_STOCK_UP_ACCOMPLISH => '备货完成',
  62. self::ORDER_AFTER_SALE_APPLY => '订单申请退款',
  63. self::ORDER_RETURN_MEMBER_DELIVER => ' 填写退/换货物流单号',
  64. self::ORDER_RETURN_APPLY_CLOSE => ' 填写退/换货物流单号',
  65. self::ORDER_RETURN_MONEY => '收到订单退款',
  66. self::ORDER_WHOLESALE_OPEN => '拼团开团成功',
  67. self::ORDER_WHOLESALE_JOIN => '拼团参团成功',
  68. self::ORDER_WHOLESALE_ACCOMPLISH => '拼团成功',
  69. self::ORDER_WHOLESALE_CLOSE => '拼团失败',
  70. self::ORDER_BARGAIN_FRIEND_JOIN => '好友帮忙砍价',
  71. self::ORDER_BARGAIN_ACCOMPLISH => '砍价成功',
  72. self::ORDER_BARGAIN_CLOSE => '砍价关闭',
  73. self::ORDER_VIRTUAL => '核销码',
  74. self::COUPON_GIVE => '收到优惠券',
  75. self::COUPON_CLOSE => '优惠券失效',
  76. self::COMMISSION => '佣金到账',
  77. self::INVOICE_APPLY => '申请发票',
  78. self::OPINION_CREATE => '意见反馈',
  79. ];
  80. }
  81. /**
  82. * @return array
  83. */
  84. public static function getMemberMap(): array
  85. {
  86. return [
  87. self::ORDER_CONSIGN => '订单发货',
  88. // self::ORDER_RECEIVING => '商家已接单',
  89. // self::ORDER_CABALLERO_RECEIVING => '骑手已接单',
  90. // self::ORDER_CABALLERO_CANCEL => '骑手已取消',
  91. self::ORDER_STOCK_UP_ACCOMPLISH => '备货完成',
  92. self::ORDER_RETURN_MEMBER_DELIVER => '填写退/换货物流单号',
  93. self::ORDER_RETURN_APPLY_CLOSE => '退款/退货商家取消',
  94. self::ORDER_RETURN_MONEY => '收到订单退款',
  95. self::ORDER_CANCEL => '商家退单',
  96. self::ORDER_WHOLESALE_OPEN => '拼团开团成功',
  97. self::ORDER_WHOLESALE_JOIN => '拼团参团成功',
  98. self::ORDER_WHOLESALE_ACCOMPLISH => '拼团成功',
  99. self::ORDER_WHOLESALE_CLOSE => '拼团失败',
  100. self::ORDER_BARGAIN_FRIEND_JOIN => '好友帮忙砍价',
  101. self::ORDER_BARGAIN_ACCOMPLISH => '砍价成功',
  102. self::ORDER_BARGAIN_CLOSE => '砍价关闭',
  103. self::ORDER_VIRTUAL => '核销码',
  104. self::COUPON_GIVE => '收到优惠券',
  105. // self::COUPON_CLOSE => '优惠券失效',
  106. // self::COMMISSION => '佣金到账',
  107. ];
  108. }
  109. /**
  110. * @return array
  111. */
  112. public static function getManagerMap(): array
  113. {
  114. return [
  115. self::ORDER_PAY => '新订单',
  116. self::ORDER_AFTER_SALE_APPLY => '订单申请退款',
  117. self::INVOICE_APPLY => '申请发票',
  118. self::OPINION_CREATE => '意见反馈',
  119. ];
  120. }
  121. /**
  122. * 默认值
  123. *
  124. * @param $action
  125. * @return array|string[]
  126. */
  127. public static function default($action)
  128. {
  129. $data = [
  130. self::ORDER_CONSIGN => [
  131. 'title' => '您的订单发货了',
  132. 'content' => '亲,你的订单已发货,订单号:{order.order_sn}',
  133. 'tables' => [
  134. [
  135. 'title' => '订单',
  136. 'prefix' => 'order',
  137. 'tableName' => Order::tableName(),
  138. 'filterFields' => [
  139. 'feedback_status',
  140. 'is_evaluate',
  141. 'auto_sign_time',
  142. 'auto_finish_time',
  143. 'auto_evaluate_time',
  144. 'auto_sign_time',
  145. 'is_print',
  146. 'refund_money',
  147. 'refund_num',
  148. 'is_after_sale',
  149. 'status',
  150. ],
  151. ],
  152. ],
  153. ],
  154. self::ORDER_RECEIVING => [
  155. 'title' => '商家已接单',
  156. 'content' => '商家已接单, 订单号: {order.order_sn}',
  157. 'tables' => [
  158. [
  159. 'title' => '订单',
  160. 'prefix' => 'order',
  161. 'tableName' => Order::tableName(),
  162. 'filterFields' => [
  163. 'feedback_status',
  164. 'is_evaluate',
  165. 'auto_sign_time',
  166. 'auto_finish_time',
  167. 'auto_evaluate_time',
  168. 'auto_sign_time',
  169. 'is_print',
  170. 'refund_money',
  171. 'refund_num',
  172. 'is_after_sale',
  173. 'status',
  174. ],
  175. ],
  176. ],
  177. ],
  178. self::ORDER_CANCEL => [
  179. 'title' => '商家已退单',
  180. 'content' => '你的订单 {order.order_sn} 已被商家取消',
  181. 'tables' => [
  182. [
  183. 'title' => '订单',
  184. 'prefix' => 'order',
  185. 'tableName' => Order::tableName(),
  186. 'filterFields' => [
  187. 'feedback_status',
  188. 'is_evaluate',
  189. 'auto_sign_time',
  190. 'auto_finish_time',
  191. 'auto_evaluate_time',
  192. 'auto_sign_time',
  193. 'is_print',
  194. 'refund_money',
  195. 'refund_num',
  196. 'is_after_sale',
  197. 'status',
  198. ],
  199. ],
  200. ],
  201. ],
  202. self::ORDER_CABALLERO_RECEIVING => [
  203. 'title' => '已被骑手接单',
  204. 'content' => '你的订单已被骑手接单,订单号:{order.order_sn}',
  205. 'tables' => [
  206. [
  207. 'title' => '订单',
  208. 'prefix' => 'order',
  209. 'tableName' => Order::tableName(),
  210. 'filterFields' => [
  211. 'feedback_status',
  212. 'is_evaluate',
  213. 'auto_sign_time',
  214. 'auto_finish_time',
  215. 'auto_evaluate_time',
  216. 'auto_sign_time',
  217. 'is_print',
  218. 'refund_money',
  219. 'refund_num',
  220. 'is_after_sale',
  221. 'status',
  222. ],
  223. ],
  224. ],
  225. ],
  226. self::ORDER_CABALLERO_CANCEL => [
  227. 'title' => '已被骑手取消',
  228. 'content' => '你的订单{order.order_sn}已被骑手取消,系统正在重新派单中',
  229. 'tables' => [
  230. [
  231. 'title' => '订单',
  232. 'prefix' => 'order',
  233. 'tableName' => Order::tableName(),
  234. 'filterFields' => [
  235. 'feedback_status',
  236. 'is_evaluate',
  237. 'auto_sign_time',
  238. 'auto_finish_time',
  239. 'auto_evaluate_time',
  240. 'auto_sign_time',
  241. 'is_print',
  242. 'refund_money',
  243. 'refund_num',
  244. 'is_after_sale',
  245. 'status',
  246. ],
  247. ],
  248. ],
  249. ],
  250. self::ORDER_PAY => [
  251. 'title' => '您有一笔新订单',
  252. 'content' => '您有一笔新订单 {order.order_sn} 请及时处理',
  253. 'tables' => [
  254. [
  255. 'title' => '订单',
  256. 'prefix' => 'order',
  257. 'tableName' => Order::tableName(),
  258. 'filterFields' => [
  259. 'feedback_status',
  260. 'is_evaluate',
  261. 'auto_sign_time',
  262. 'auto_finish_time',
  263. 'auto_evaluate_time',
  264. 'auto_sign_time',
  265. 'is_print',
  266. 'refund_money',
  267. 'refund_num',
  268. 'is_after_sale',
  269. 'status',
  270. ],
  271. ],
  272. ],
  273. ],
  274. self::ORDER_STOCK_UP_ACCOMPLISH => [
  275. 'title' => '备货完成啦',
  276. 'content' => '亲,你的订单 {order.order_sn} 已备货完成,请在规定时间内完成支付',
  277. 'tables' => [
  278. [
  279. 'title' => '订单',
  280. 'prefix' => 'order',
  281. 'tableName' => Order::tableName(),
  282. 'filterFields' => [
  283. 'feedback_status',
  284. 'is_evaluate',
  285. 'auto_sign_time',
  286. 'auto_finish_time',
  287. 'auto_evaluate_time',
  288. 'auto_sign_time',
  289. 'is_print',
  290. 'refund_money',
  291. 'refund_num',
  292. 'is_after_sale',
  293. 'status',
  294. ],
  295. ],
  296. ],
  297. ],
  298. self::ORDER_AFTER_SALE_APPLY => [
  299. 'title' => '您有一笔订单进行退款申请',
  300. 'content' => '你有一笔订单{order.order_sn}正在申请退款,请及时处理',
  301. 'tables' => [
  302. [
  303. 'title' => '订单',
  304. 'prefix' => 'order',
  305. 'tableName' => Order::tableName(),
  306. 'filterFields' => [
  307. 'feedback_status',
  308. 'is_evaluate',
  309. 'auto_sign_time',
  310. 'auto_finish_time',
  311. 'auto_evaluate_time',
  312. 'auto_sign_time',
  313. 'is_print',
  314. 'refund_money',
  315. 'refund_num',
  316. 'is_after_sale',
  317. 'status',
  318. ],
  319. ],
  320. ],
  321. ],
  322. self::ORDER_RETURN_MEMBER_DELIVER => [
  323. 'title' => '请填写退/换货物流单号',
  324. 'content' => '您的订单 {afterSafe.order_sn} 中的商品,请填写退/换货物流单号。',
  325. 'tables' => [
  326. [
  327. 'title' => '售后申请',
  328. 'prefix' => 'afterSale',
  329. 'tableName' => AfterSale::tableName(),
  330. 'filterFields' => [
  331. 'status',
  332. ],
  333. ],
  334. [
  335. 'title' => '订单商品',
  336. 'prefix' => 'orderProduct',
  337. 'tableName' => OrderProduct::tableName(),
  338. 'filterFields' => [
  339. 'is_evaluate',
  340. 'gift_flag',
  341. 'after_sale_id',
  342. 'is_commission',
  343. 'status',
  344. ],
  345. ],
  346. ],
  347. ],
  348. self::ORDER_RETURN_MONEY => [
  349. 'title' => '收到一笔订单退款',
  350. 'content' => '您的订单 {afterSale.order_sn} 中的商品,产生了退款共计 {orderProduct.refund_balance_money} 元, 请在 7 个工作日内注意查收。',
  351. 'tables' => [
  352. [
  353. 'title' => '售后申请',
  354. 'prefix' => 'afterSale',
  355. 'tableName' => AfterSale::tableName(),
  356. 'filterFields' => [
  357. 'status',
  358. ],
  359. ],
  360. [
  361. 'title' => '订单商品',
  362. 'prefix' => 'orderProduct',
  363. 'tableName' => OrderProduct::tableName(),
  364. 'filterFields' => [
  365. 'is_evaluate',
  366. 'gift_flag',
  367. 'after_sale_id',
  368. 'is_commission',
  369. 'status',
  370. ],
  371. ],
  372. ],
  373. ],
  374. self::ORDER_RETURN_APPLY_CLOSE => [
  375. 'title' => '有一笔订单退款/退货申请被取消',
  376. 'content' => '您的订单 {afterSale.order_sn} 中的商品申请退款已被商家取消,请去售后查看详情。',
  377. 'tables' => [
  378. [
  379. 'title' => '售后申请',
  380. 'prefix' => 'afterSale',
  381. 'tableName' => AfterSale::tableName(),
  382. 'filterFields' => [
  383. 'status',
  384. ],
  385. ],
  386. [
  387. 'title' => '订单商品',
  388. 'prefix' => 'orderProduct',
  389. 'tableName' => OrderProduct::tableName(),
  390. 'filterFields' => [
  391. 'is_evaluate',
  392. 'gift_flag',
  393. 'after_sale_id',
  394. 'is_commission',
  395. 'status',
  396. ],
  397. ],
  398. ],
  399. ],
  400. self::ORDER_WHOLESALE_OPEN => [
  401. 'title' => '拼团开团成功啦',
  402. 'content' => '恭喜您开团成功,分享给好友参团成团更快',
  403. 'tables' => [
  404. [
  405. 'title' => '订单',
  406. 'prefix' => 'order',
  407. 'tableName' => Order::tableName(),
  408. 'filterFields' => [
  409. 'feedback_status',
  410. 'is_evaluate',
  411. 'auto_sign_time',
  412. 'auto_finish_time',
  413. 'auto_evaluate_time',
  414. 'auto_sign_time',
  415. 'is_print',
  416. 'refund_money',
  417. 'refund_num',
  418. 'is_after_sale',
  419. 'status',
  420. ],
  421. ],
  422. ],
  423. ],
  424. self::ORDER_WHOLESALE_JOIN => [
  425. 'title' => '拼团参团成功啦',
  426. 'content' => '恭喜您参团成功,分享给好友参团成团更快',
  427. 'tables' => [
  428. [
  429. 'title' => '订单',
  430. 'prefix' => 'order',
  431. 'tableName' => Order::tableName(),
  432. 'filterFields' => [
  433. 'feedback_status',
  434. 'is_evaluate',
  435. 'auto_sign_time',
  436. 'auto_finish_time',
  437. 'auto_evaluate_time',
  438. 'auto_sign_time',
  439. 'is_print',
  440. 'refund_money',
  441. 'refund_num',
  442. 'is_after_sale',
  443. 'status',
  444. ],
  445. ],
  446. ],
  447. ],
  448. self::ORDER_WHOLESALE_ACCOMPLISH => [
  449. 'title' => '您的拼团成功了',
  450. 'content' => '恭喜您,您有一笔拼团订单已拼团成功,商家将尽快为您发货',
  451. 'tables' => [
  452. [
  453. 'title' => '订单',
  454. 'prefix' => 'order',
  455. 'tableName' => Order::tableName(),
  456. 'filterFields' => [
  457. 'feedback_status',
  458. 'is_evaluate',
  459. 'auto_sign_time',
  460. 'auto_finish_time',
  461. 'auto_evaluate_time',
  462. 'auto_sign_time',
  463. 'is_print',
  464. 'refund_money',
  465. 'refund_num',
  466. 'is_after_sale',
  467. 'status',
  468. ],
  469. ],
  470. ],
  471. ],
  472. self::ORDER_WHOLESALE_CLOSE => [
  473. 'title' => '拼团因人数不足被关闭了',
  474. 'content' => '您参加的拼团活动因人数不足拼团失败,退款将在7个工作日内原路返回至您的支付账号,请注意查收!',
  475. 'tables' => [
  476. ],
  477. ],
  478. self::ORDER_VIRTUAL => [
  479. 'title' => '核销码',
  480. 'content' => '快来点击查看具体信息!',
  481. 'tables' => [
  482. ],
  483. ],
  484. self::COUPON_GIVE => [
  485. 'title' => '收到一张优惠券',
  486. 'content' => '您收到了一张{couponType.type}优惠券',
  487. 'tables' => [
  488. [
  489. 'title' => '优惠券',
  490. 'prefix' => 'couponType',
  491. 'tableName' => CouponType::tableName(),
  492. ],
  493. ],
  494. ],
  495. self::COUPON_CLOSE => [
  496. 'title' => '优惠券有效期已过',
  497. 'content' => '',
  498. 'tables' => [
  499. [
  500. 'title' => '优惠券',
  501. 'prefix' => 'couponType',
  502. 'tableName' => CouponType::tableName(),
  503. ],
  504. ],
  505. ],
  506. self::COMMISSION => [
  507. 'title' => '佣金到账了',
  508. 'content' => '',
  509. 'tables' => [
  510. ],
  511. ],
  512. self::OPINION_CREATE => [
  513. 'title' => '意见反馈',
  514. 'content' => '有人提了一个反馈消息',
  515. 'tables' => [
  516. ],
  517. ],
  518. self::INVOICE_APPLY => [
  519. 'title' => '发票申请',
  520. 'content' => '有一个新的发票申请,请及时处理',
  521. 'tables' => [
  522. ],
  523. ],
  524. ];
  525. return $data[$action] ?? [];
  526. }
  527. }
粤ICP备19079148号