<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2017/11/21
 * Time: 10:42
 */

namespace App\Modules\User\Models;

use Illuminate\Database\Eloquent\Model;
use DB;

class UserSubscribeBehaviorStats extends Model
{
    protected $table = 'user_subscribe_statistics';

    protected $fillable = ['id', 'date', 'appid', 'new_subscribe_num', 'recharge_sum','one_day_recharge',
        'three_days_recharge','actual_subscibe_num','seven_days_recharge','thirty_days_recharge',
        'sixty_days_recharge','new_sub_recharge_num','sub_user_orders_num','yesterday_actual_new_user',
        'yesterday_actual_sub_num'
    ];

    public static function getList($date='') {
         if(empty($date)){
             return self::paginate();
         }else{
             $obj = self::where('date',$date);
             //if ($date) $obj->where('date',$date);
             return $obj->get();
         }

    }
}