quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
 
namespace app\common\model\takeout;
 
use app\common\model\BaseModel;
 
/**
 * 模型
 */
class School extends BaseModel
{
    protected $name = 'takeout_school';
    protected $pk = 'school_id';
 
    /**
     * 所有
     * @return \think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getALL()
    {
        $model = new static;
        return $model->where('is_delete', '=', 0)->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
    }
    /**
     * 详情
     */
    public static function detail($school_id)
    {
       return (new static())->find($school_id);
    }
 
}