1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\admin\model\routine;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- class RoutineTemplate extends BaseModel
- {
-
- protected $pk = 'id';
-
- protected $name = 'template_message';
- use ModelTrait;
- public static function vialdWhere(string $alias = '', int $type = 0)
- {
- if ($alias) {
- $alias .= '.';
- }
- return self::where($alias . 'type', $type);
- }
-
- public static function systemPage($where = array())
- {
- $model = self::vialdWhere();
- if ($where['name'] !== '') $model = $model->where('name', 'LIKE', "%$where[name]%");
- if ($where['status'] !== '') $model = $model->where('status', $where['status']);
- return self::page($model, $where);
- }
-
- public static function getTempid($tempkey)
- {
- return self::vialdWhere()->where('tempkey', $tempkey)->where('status', 1)->cache(true, 3600)->value('tempid');
- }
- }
|