RoutineTemplate.php 977 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/02
  6. */
  7. namespace app\admin\model\routine;
  8. use traits\ModelTrait;
  9. use basic\ModelBasic;
  10. use think\Cache;
  11. /**
  12. * 小程序模板消息Model
  13. * Class RoutineTemplate
  14. * @package app\admin\model\wechat
  15. */
  16. class RoutineTemplate extends ModelBasic
  17. {
  18. use ModelTrait;
  19. /**
  20. * 获取系统分页数据 分类
  21. * @param array $where
  22. * @return array
  23. */
  24. public static function systemPage($where = array()){
  25. $model = new self;
  26. if($where['name'] !== '') $model = $model->where('name','LIKE',"%$where[name]%");
  27. if($where['status'] !== '') $model = $model->where('status',$where['status']);
  28. return self::page($model);
  29. }
  30. /**
  31. * 根据模版编号获取模版ID
  32. * @param $tempkey
  33. */
  34. public static function getTempid($tempkey){
  35. return self::where('tempkey',$tempkey)->where('status',1)->cache(true,3600)->value('tempid');
  36. }
  37. }