BatchCustomSendMsgs.php 812 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Modules\OfficialAccount\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use DB;
  5. class BatchCustomSendMsgs extends Model
  6. {
  7. protected $connection = 'api_mysql';
  8. protected $tables = 'batch_custom_send_msgs';
  9. protected $fillable = ['name','send_time','content','redirect_url','status','subscribe_time','sex','balance','order_type','category_id','del_flag','is_full_send'];
  10. /**
  11. * 根据id获取
  12. */
  13. static function batchCustomMsgById($id)
  14. {
  15. return self::where('id', $id)->first();
  16. }
  17. /**
  18. * 更新状态
  19. */
  20. static function updateBatchCustomSendMsgStatusById($id,$status,$del_flag=0)
  21. {
  22. return self::where('id', $id)->update(['status'=>$status,'del_flag'=>$del_flag,'updated_at'=>date('Y-m-d H:i:s')]);
  23. }
  24. }