正在显示
1 个修改的文件
包含
4 行增加
和
5 行删除
| @@ -2,8 +2,7 @@ | @@ -2,8 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Models; | 3 | namespace App\Models; |
| 4 | 4 | ||
| 5 | -use App\Models\File\Image; | ||
| 6 | -use App\Services\CosService; | 5 | +use Illuminate\Support\Arr; |
| 7 | use Illuminate\Database\Eloquent\Model; | 6 | use Illuminate\Database\Eloquent\Model; |
| 8 | class Base extends Model | 7 | class Base extends Model |
| 9 | { | 8 | { |
| @@ -93,7 +92,7 @@ class Base extends Model | @@ -93,7 +92,7 @@ class Base extends Model | ||
| 93 | public function add($data){ | 92 | public function add($data){ |
| 94 | $data['created_at'] = date('Y-m-d H:i:s'); | 93 | $data['created_at'] = date('Y-m-d H:i:s'); |
| 95 | $data['updated_at'] = $data['created_at']; | 94 | $data['updated_at'] = $data['created_at']; |
| 96 | - $filLabelData = array_only($data, $this->getFillable()); | 95 | + $filLabelData = Arr::only($data, $this->getFillable()); |
| 97 | return $this->insert($filLabelData); | 96 | return $this->insert($filLabelData); |
| 98 | } | 97 | } |
| 99 | 98 | ||
| @@ -107,7 +106,7 @@ class Base extends Model | @@ -107,7 +106,7 @@ class Base extends Model | ||
| 107 | public function addReturnId($data){ | 106 | public function addReturnId($data){ |
| 108 | $data['created_at'] = date('Y-m-d H:i:s'); | 107 | $data['created_at'] = date('Y-m-d H:i:s'); |
| 109 | $data['updated_at'] = $data['created_at']; | 108 | $data['updated_at'] = $data['created_at']; |
| 110 | - $filLabelData = array_only($data, $this->getFillable()); | 109 | + $filLabelData = Arr::only($data, $this->getFillable()); |
| 111 | return $this->insertGetId($filLabelData); | 110 | return $this->insertGetId($filLabelData); |
| 112 | } | 111 | } |
| 113 | 112 | ||
| @@ -124,7 +123,7 @@ class Base extends Model | @@ -124,7 +123,7 @@ class Base extends Model | ||
| 124 | } | 123 | } |
| 125 | $query = $this->formatQuery($condition); | 124 | $query = $this->formatQuery($condition); |
| 126 | $data['updated_at'] = date('Y-m-d H:i:s'); | 125 | $data['updated_at'] = date('Y-m-d H:i:s'); |
| 127 | - $filLabelData = array_only($data, $this->getFillable()); | 126 | + $filLabelData = Arr::only($data, $this->getFillable()); |
| 128 | return $query->update($filLabelData); | 127 | return $query->update($filLabelData); |
| 129 | 128 | ||
| 130 | } | 129 | } |
-
请 注册 或 登录 后发表评论