123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Modules\Push\Models;
- use Illuminate\Database\Eloquent\Model;
- class QappPushTask extends Model
- {
- protected $table = 'qapp_push_task';
- protected $fillable = ['uid', 'package_id', 'type', 'title', 'content', 'url', 'num',
- 'status', 'providers', 'push_time', 'push_filter', 'push_result'];
- /**
- * @param $id
- * @return array
- */
- public static function getPushTaskById($id): array
- {
- if (empty($id)) {
- return [];
- }
- $result = self::where('id', $id)->first();
- return $result ? $result->toArray() : [];
- }
- /**
- * @param $id
- * @param $data
- * @return bool
- */
- public static function updatePushTask($id, $data): bool
- {
- if (empty($id) || empty($data)) {
- return false;
- }
- return self::where('id', $id)->update($data);
- }
- }
|