TemplateMsg.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\admin\controller\shop;
  3. use app\common\controller\Backend;
  4. /**
  5. * 模板消息
  6. *
  7. * @icon fa fa-circle-o
  8. */
  9. class TemplateMsg extends Backend
  10. {
  11. /**
  12. * TemplateMsg模型对象
  13. * @var \app\admin\model\shop\TemplateMsg
  14. */
  15. protected $model = null;
  16. public function _initialize()
  17. {
  18. parent::_initialize();
  19. $this->model = new \app\admin\model\shop\TemplateMsg;
  20. $this->view->assign("typeList", $this->model->getTypeList());
  21. $this->view->assign("eventList", $this->model->getEventList());
  22. $this->assign('template_data', json_encode([
  23. 'order_sn' => '订单编号',
  24. 'nickname' => '用户昵称',
  25. 'createtime' => '下单时间',
  26. 'amount' => '订单金额',
  27. 'discount' => '优惠金额',
  28. 'shippingfee' => '配送费用',
  29. 'saleamount' => '应付款金额',
  30. 'paytime' => '支付时间',
  31. 'shippingtime' => '发货时间',
  32. 'receivetime' => '收货时间',
  33. 'diy_text' => '自定义文本',
  34. ]));
  35. }
  36. /**
  37. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  38. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  39. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  40. */
  41. }