<?php

namespace App\Models;

/**
 *
 */
class MoneyRed extends BaseModel {

	protected $table = 'money_red';
	public $timestamps = false;
	//插入红包数据
	function insertData($data){
	    $data['create_time']=date('Y-m-d H:i:s');
	    $data['system_user']=session('adminInfo.admin_name');
	    $res=$this->insert($data);
	    if(!$res){
	        return -502349012;
        }
        return  $data['input_order'];
    }
    //获取列表
    function getList($list=10,$where){
	    $data=$this;
	    if(!empty($where)){
            $data->where($where);
        }
        $data=$data->orderBy('id','desc')->paginate($list);
        if(!$data){
            return -5012345332;
        }
        return $data->toArray();
    }
}

?>