|
@@ -28,11 +28,7 @@ class SpecialController extends Curd
|
|
|
|
|
|
protected function doSelect(array $where, string $field = null, string $order = 'desc')
|
|
protected function doSelect(array $where, string $field = null, string $order = 'desc')
|
|
{
|
|
{
|
|
- $model = $this->model->with([
|
|
|
|
- 'category' => function ($query) {
|
|
|
|
- $query->select('category_id', 'category_name');
|
|
|
|
- }
|
|
|
|
- ]);
|
|
|
|
|
|
+ $model = $this->model;
|
|
foreach ($where as $column => $value) {
|
|
foreach ($where as $column => $value) {
|
|
if (is_array($value)) {
|
|
if (is_array($value)) {
|
|
if ($value[0] === 'like' || $value[0] === 'not like') {
|
|
if ($value[0] === 'like' || $value[0] === 'not like') {
|
|
@@ -101,6 +97,8 @@ class SpecialController extends Curd
|
|
$primary_key = $this->model->getKeyName();
|
|
$primary_key = $this->model->getKeyName();
|
|
$id = $request->post($primary_key);
|
|
$id = $request->post($primary_key);
|
|
$data = $this->inputFilter($request->post());
|
|
$data = $this->inputFilter($request->post());
|
|
|
|
+ $data['content_updatetimes'] = time();
|
|
|
|
+
|
|
$model = $this->model->find($id);
|
|
$model = $this->model->find($id);
|
|
|
|
|
|
if (!$model) {
|
|
if (!$model) {
|
|
@@ -110,7 +108,7 @@ class SpecialController extends Curd
|
|
if (!empty($request->post('cover'))) {
|
|
if (!empty($request->post('cover'))) {
|
|
$configJson = !empty($model->content_config_json) ? json_decode($model->content_config_json, true) : [];
|
|
$configJson = !empty($model->content_config_json) ? json_decode($model->content_config_json, true) : [];
|
|
$configJson['cover'] = str_replace(getenv("STORAGE_DOMAIN"), '', $request->post('cover'));
|
|
$configJson['cover'] = str_replace(getenv("STORAGE_DOMAIN"), '', $request->post('cover'));
|
|
- $model->content_config_json = json_encode($configJson);
|
|
|
|
|
|
+ $data['content_config_json'] = json_encode($configJson);
|
|
}
|
|
}
|
|
|
|
|
|
unset($data[$primary_key]);
|
|
unset($data[$primary_key]);
|