<?php
declare (strict_types = 1);

namespace app\model\admin;

use Closure;
use library\basic\BaseModel;
use library\traits\JwtAuthModelTrait;
use library\traits\ModelTrait;
use think\Model;

/**
 * @mixin \think\Model
 */
class MemberLevel extends BaseModel
{
    use ModelTrait;
    use JwtAuthModelTrait;
    //


    /**
     * 获取列表数据
     * @param $page
     * @param $where
     * @param $pageCount
     * @param $desc
     */
    public function getList($page,$where = [],$pageCount = 20,$filed = '*',$desc = ''){
        $data =  $this
            ->field("ml.*,(select update_money from table_site_level where level_id = ml.id and sass_id = "
                . $where['sassid']
                ." ) as update_money")
            ->alias("ml")
            ->order($desc)
            ->paginate(['list_rows'=>$pageCount,'page'=>$page])
            ->toArray();
        // echo $this->getLastSql();
        return [$data['total'],$data['data']];
    }


}
