ServiceCmsMessage.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: vowkin
  5. * Date: 2017/5/22
  6. * Time: 21:49
  7. */
  8. namespace app\common\service;
  9. use app\common\model\MessageModel;
  10. use think\Config;
  11. class ServiceCmsMessage extends BaseService
  12. {
  13. //`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
  14. //`title` varchar(20) DEFAULT NULL COMMENT '消息标题',
  15. //`content` text COMMENT '内容',
  16. //`user_no` varchar(20) DEFAULT NULL COMMENT '接收会员编号',
  17. //`add_ts` int(11) DEFAULT NULL COMMENT '添加时间',
  18. //`admin_id` varchar(20) DEFAULT NULL COMMENT '发送消息管理员编号',
  19. //`type` tinyint(4) DEFAULT NULL COMMENT '1系统信息,2个人信息',
  20. // 站内信发送
  21. public $message;
  22. //后台发送物流信息
  23. public static function sendLogistics($param=[]){
  24. $message=new MessageModel();
  25. $data=[
  26. 'title'=>'物流订单已发货',
  27. 'content'=>'您有一个订单已经发货了,请在我的订单中查看详细物流信息!',
  28. 'user_no'=>$param['user_no'],
  29. 'add_ts'=>time(),
  30. 'admin_id'=>0,
  31. 'type'=>2,
  32. ];
  33. return $message->saveData($data);
  34. }
  35. //后台重新发送物流信息
  36. public static function sendLogisticsReset($param=[]){
  37. $message=new MessageModel();
  38. $data=[
  39. 'title'=>'订单物流重新发送',
  40. 'content'=>'您有一个订单已经重新发货,请在微信我的订单中查看详细信息',
  41. 'user_no'=>$param['user_no'],
  42. 'add_ts'=>time(),
  43. 'admin_id'=>0,
  44. 'type'=>2,
  45. ];
  46. return $message->saveData($data);
  47. }
  48. //订单退款信息提醒
  49. public static function sendOrderRefund($param=[]){
  50. $message=new MessageModel();
  51. $data=[
  52. 'title'=>'订单退款通知',
  53. 'content'=>'您有一个订单系统已完成退款,请在微信中查询退款信息!',
  54. 'user_no'=>$param['user_no'],
  55. 'add_ts'=>time(),
  56. 'admin_id'=>$param['admin_id'],
  57. 'type'=>2,
  58. ];
  59. return $message->saveData($data);
  60. }
  61. //订单审核售后信息提醒 不同意推送
  62. public static function sendOrderSales($param=[]){
  63. $message=new MessageModel();
  64. $data=[
  65. 'title'=>'订单售后审核通知',
  66. 'content'=>'尊敬的会员,您好!很抱歉,您的订单'.$param['order_no'].'退款申请没有通过审核,如有问题请联系客户:'.Config::get('service_mobile'),
  67. 'user_no'=>$param['user_no'],
  68. 'add_ts'=>time(),
  69. 'admin_id'=>$param['admin_id'],
  70. 'type'=>2,
  71. ];
  72. return $message->saveData($data);
  73. }
  74. }