| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 | <?phpnamespace app\common\service;use app\admin\attr\Permission;use app\common\model\IoDetail;use app\common\util\WhereBuilder;#[Permission('io_detail')]class IoDetailService extends Service{    public function page($params = [])    {        $params = $this->autoParams($params);        $repo_id = $this->pg('repo_id');        $where = WhereBuilder::builder()            ->eq('d.repo_id', $repo_id)            ->build();        return (new IoDetail)->alias('d')            ->field('d.*, r.name as repo_name, g.name as good_name')            ->join('repo r', 'r.id = d.repo_id', 'LEFT')            ->join('good g', 'g.id = d.good_id', 'LEFT')            ->where($where)            ->order('d.create_time desc')            ->paginate($this->tp6Page());    }    public function transits($params = [])    {        $params = $this->autoParams($params);        $transit_status = $this->pg('transit_status');        $repo_id = $this->pg('repo_id');        $io_id = $this->pg('io_id');        $where = WhereBuilder::builder()            ->in('d.transit_status', $transit_status)            ->eq('d.repo_id', $repo_id)            ->eq('d.io_id', $io_id)            ->build();        return (new IoDetail)->alias('d')            ->field('d.*, r.name as repo_name, g.name as good_name, g.no as good_no')            ->join('repo r', 'r.id = d.repo_id', 'LEFT')            ->join('good g', 'g.id = d.good_id', 'LEFT')            ->where($where)            ->select();    }}
 |