1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\models\course;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- class OrganModel extends BaseModel
- {
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'id';
- /**
- * 模型名称
- * @var string
- */
- protected $name = 'organ';
- use ModelTrait;
- public static function systemPage($where)
- {
- $model = new self;
- $model = $model->where('is_del', 0);
- $count = $model->count();
- $list = $model->page((int)$where['page'], (int)$where['limit'])->select()->each(function ($item) {
- $item['_add_time'] = date('Y-m-d H:i:s', $item['add_time']);
- })->toArray();
- return compact('count', 'list');
- }
- /**
- * 详情
- */
- public static function getOne($id)
- {
- $info = self::where('is_del', 0)->find($id);
- return $info;
- }
- }
|