<?php

namespace App\Models;
use DB;
class LuckyMoneyTake extends BaseModel {

	protected $table = 'lucky_money_take';
	public $timestamps = false;
    //获取列表
    function getList($list=10,$where){
	    $data=array();
	    if(!empty($where)){
            $data=$this->where($where)->orderBy('id','desc')->paginate($list);
        }else{
            $data=$this->orderBy('id','desc')->paginate($list);
        }
        
        if(!$data){
            return -5012345332;
        }
        return $data->toArray();
    }

    function getReceive($list,$where){
        $data=$this->join ('account', 'account.identity', '=', 'lucky_money_take.account_identity')
            ->select(DB::raw('account,lucky_money_take.account_identity,time,room_id,money,lm_id'))->where($where)->orderBy('time','desc')->paginate($list);
        if(!$data){
            return -5012345332;
        }
        return $data->toArray();
    }


}

?>