|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
-
-
- namespace app\model\diy;
-
-
- use crmeb\basic\BaseModel;
- use crmeb\traits\ModelTrait;
- use think\Model;
-
- class PageLink extends BaseModel
- {
- use ModelTrait;
-
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'id';
-
- /**
- * 模型名称
- * @var string
- */
- protected $name = 'page_link';
-
- /**
- * 分类搜索器
- * @param Model $query
- * @param $value
- */
- public function searchCateIdAttr($query, $value)
- {
- if ($value) {
- if (is_array($value)) {
- $query->whereIn('cate_id', $value);
- } else {
- $query->where('cate_id', $value);
- }
- }
- }
-
- /**
- * 是否使用搜索器
- * @param Model $query
- * @param $value
- */
- public function searchStatusAttr($query, $value)
- {
- if ($value != '') $query->where('status', $value);
- }
- }
|