123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace catchAdmin\wind\model;
- use catcher\base\CatchModel as Model;
- use think\facade\Db;
- use catchAdmin\wind\model\get\FanGet;
- use catchAdmin\wind\model\search\FanSearch;
- use catchAdmin\permissions\model\DataRangScopeTrait;
- class Fan extends Model
- {
- use DataRangScopeTrait;
- use FanGet;
- use FanSearch;
- // 表名
- public $name = 'fan';
- // 数据库字段映射
- public $field = array(
- 'id',
- // 风厂的id
- 'wind_id',
- // 编号
- 'number',
- 'fan_model',
- 'longitude',
- 'latitude',
- 'info',
- // 创建人ID
- 'creator_id',
- // 创建时间
- 'created_at',
- // 更新时间
- 'updated_at',
- // 软删除
- 'deleted_at',
-
- );
- public function getList()
- {
- return $this->dataRange()
- ->catchSearch()
- ->append(['wind_name','model_name'])
- ->field('*')
- ->catchOrder()
- ->creator()
- ->paginate();
- }
- public function getFanList()
- {
- return $this->dataRange()
- ->catchSearch()
- ->field('id as value,number as name')
- ->catchOrder()
- ->select();
- }
- }
|