|
@@ -132,10 +132,8 @@ class NewsController
|
|
|
unset($data['cover']);
|
|
unset($data['cover']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 添加创建时间和更新时间(临时注释测试)
|
|
|
|
|
- // $currentTime = date('Y-m-d H:i:s');
|
|
|
|
|
- // $data['create_time'] = $currentTime;
|
|
|
|
|
- // $data['update_time'] = $currentTime;
|
|
|
|
|
|
|
+ // 不传递时间字段,让 Go 服务自动设置
|
|
|
|
|
+ // Go 服务会在创建时自动设置 create_time 和 update_time
|
|
|
|
|
|
|
|
$res = $this->service->create($data);
|
|
$res = $this->service->create($data);
|
|
|
return json(['code' => 200, 'msg' => '创建成功', 'data' => $res]);
|
|
return json(['code' => 200, 'msg' => '创建成功', 'data' => $res]);
|
|
@@ -166,8 +164,8 @@ class NewsController
|
|
|
unset($data['cover']);
|
|
unset($data['cover']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 添加更新时间(临时注释测试)
|
|
|
|
|
- // $data['update_time'] = date('Y-m-d H:i:s');
|
|
|
|
|
|
|
+ // 不传递时间字段,让 Go 服务自动设置
|
|
|
|
|
+ // Go 服务会在更新时自动设置 update_time
|
|
|
|
|
|
|
|
$res = $this->service->update($id, $data);
|
|
$res = $this->service->update($id, $data);
|
|
|
if (!$res) {
|
|
if (!$res) {
|