<?php

namespace App\Modules\OfficialAccount\Models;

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

class BatchCustomSendMsgs extends Model
{
    protected $connection = 'api_mysql';
    protected $tables = 'batch_custom_send_msgs';
    protected $fillable = ['name','send_time','content','redirect_url','status','subscribe_time','sex','balance','order_type','category_id','del_flag','is_full_send'];

  
    /**
     * 根据id获取
     */
    static function batchCustomMsgById($id)
    {
        return self::where('id', $id)->first();
    }
    
    /**
    * 更新状态
    */
    static function updateBatchCustomSendMsgStatusById($id,$status,$del_flag=0)
    {
    	return self::where('id', $id)->update(['status'=>$status,'del_flag'=>$del_flag,'updated_at'=>date('Y-m-d H:i:s')]);
    }
    

}