<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class StLqResult
 * @package App\Http\Model
 * 球队管理
 */
class Stteam extends Model
{
    protected $table = 'st_team';
    public $timestamps = false;

    /*
     * 球队管理列表
     */
    function teamlist($list = 10, $page, $where = ''){
        if (is_array ($where) && count ($where) > 0) {
            $data = $this->leftjoin('st_team_list','st_team.id','=','st_team_list.pid')
                ->select($this->table.'.*','st_team_list.resultjg')
                ->orderby('st_team.id','desc')->where($where)->paginate ($list);
            // $data = $this->where($where)->orderby('id','desc')->paginate ($list);
        } else { 
            $data = $this->leftjoin('st_team_list','st_team.id','=','st_team_list.pid')
                ->select($this->table.'.*','st_team_list.resultjg')
                ->orderby('st_team.id','desc')->paginate ($list);
            // $data = $this->orderby('id','desc')->paginate ($list);
        }

        return $data->toArray ();
        
    }



}