QappPushTaskLogs.php 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Modules\Push\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class QappPushTaskLogs extends Model
  5. {
  6. protected $table = 'qapp_push_task_logs';
  7. protected $fillable = ['task_id', 'app_id', 'num', 'status', 'push_time', 'push_result'];
  8. /**
  9. * @param $taskId
  10. * @return array
  11. */
  12. public static function getPushTaskLogsByTaskId($taskId): array
  13. {
  14. if (empty($taskId)) {
  15. return [];
  16. }
  17. $result = self::where('task_id', $taskId)->get();
  18. return $result ? $result->toArray() : [];
  19. }
  20. /**
  21. * @param $where
  22. * @param $data
  23. * @return bool
  24. */
  25. public static function updateData($where, $data)
  26. {
  27. if (empty($where) || empty($data)) {
  28. return false;
  29. }
  30. return self::where($where)->update($data);
  31. }
  32. }