TemplateMessage.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 17/03/2017
  6. * Time: 16:26
  7. */
  8. namespace app\common\models;
  9. class TemplateMessage extends BaseModel
  10. {
  11. public $table = 'yz_template_message';
  12. //可用
  13. const STATUS_ENABLED = 1;
  14. //不可用
  15. const STATUS_DISABLED = 0;
  16. /**
  17. * 初始化模板消息
  18. */
  19. public function init()
  20. {
  21. //array getAllTemplates() 获取所有模板列表
  22. //已经设置的则更新status 为 可用
  23. //未更新则string addTemplate($shortId) 添加模板并获取模板ID;
  24. //将模板ID更新到数据库
  25. }
  26. public function getAllTemplates()
  27. {
  28. return static::where('parent_item','')->get();
  29. }
  30. /**
  31. * 发送模板消息
  32. */
  33. public function send($item, $openid, $data)
  34. {
  35. }
  36. public function getTemplateByItem($item)
  37. {
  38. }
  39. /**
  40. * 添加模板消息
  41. */
  42. public function add()
  43. {
  44. }
  45. /**
  46. * 修改模板消息
  47. */
  48. public function edit()
  49. {
  50. }
  51. }