Browse Source

设置works默认值

tbphp 1 year ago
parent
commit
b711ee7174
1 changed files with 5 additions and 0 deletions
  1. 5 0
      application/admin/model/Content.php

+ 5 - 0
application/admin/model/Content.php

@@ -311,6 +311,11 @@ class Content extends Model
             $data['works'] = json_encode($works);
         }
 
+        // 设置works默认值
+        if (!isset($data['works'])) {
+            $data['works'] = '';
+        }
+
         // 装备
         if (isset($data['equipment']) && $data['equipment']) {
             $data['equipment'] = implode(',', $data['equipment']);