作者 lyh

gx

... ... @@ -2,8 +2,7 @@
namespace App\Models;
use App\Models\File\Image;
use App\Services\CosService;
use Illuminate\Support\Arr;
use Illuminate\Database\Eloquent\Model;
class Base extends Model
{
... ... @@ -93,7 +92,7 @@ class Base extends Model
public function add($data){
$data['created_at'] = date('Y-m-d H:i:s');
$data['updated_at'] = $data['created_at'];
$filLabelData = array_only($data, $this->getFillable());
$filLabelData = Arr::only($data, $this->getFillable());
return $this->insert($filLabelData);
}
... ... @@ -107,7 +106,7 @@ class Base extends Model
public function addReturnId($data){
$data['created_at'] = date('Y-m-d H:i:s');
$data['updated_at'] = $data['created_at'];
$filLabelData = array_only($data, $this->getFillable());
$filLabelData = Arr::only($data, $this->getFillable());
return $this->insertGetId($filLabelData);
}
... ... @@ -124,7 +123,7 @@ class Base extends Model
}
$query = $this->formatQuery($condition);
$data['updated_at'] = date('Y-m-d H:i:s');
$filLabelData = array_only($data, $this->getFillable());
$filLabelData = Arr::only($data, $this->getFillable());
return $query->update($filLabelData);
}
... ...