|
...
|
...
|
@@ -110,7 +110,6 @@ class Base extends Model |
|
|
|
*/
|
|
|
|
public function addReturnId($data){
|
|
|
|
$data = $this->filterRequestData($data,$this->table);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$data['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$data['updated_at'] = $data['created_at'];
|
|
|
|
return $this->insertGetId($data);
|
|
...
|
...
|
@@ -267,6 +266,7 @@ class Base extends Model |
|
|
|
{
|
|
|
|
// 获取表的字段列表
|
|
|
|
$columns = Schema::getColumnListing($table);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($columns, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// 过滤数据
|
|
|
|
return array_filter($data, function ($key) use ($columns) {
|
|
|
|
return in_array($key, $columns);
|
...
|
...
|
|