lip пре 3 месеци
родитељ
комит
dbacaa92f2

+ 1 - 1
app/admin/controller/Complaint.php

@@ -44,7 +44,7 @@ class Complaint extends BaseController
                 $query->where('complaint.created_at', '<=', $params['end_time'] . ' 23:59:59');
             }
             $count = $query->count();
-            $list = $query->with(['complaint_item', 'user'])
+            $list = $query->with(['complaint_item', 'user', 'operation'])
                         ->field(['complaint.*', 'admin.nickname','admin.phone'])
                         ->order('complaint.created_at','desc')
                         ->limit($limit)

+ 18 - 0
app/admin/controller/DedicatedLine.php

@@ -89,4 +89,22 @@ class DedicatedLine extends BaseController
         return $this->success([],'删除成功');
     }
 
+    //设置是否推荐
+    public function setStatus()
+    {
+        try {
+            
+            $params = (new DedicatedLineValidate)->goCheck('id');
+            $info = DedicatedLineModel::where('id', $params['id'])->find();
+            if (!$info) {
+                return $this->error('专线不存在');
+            }
+            $info->is_rec = $info->is_rec == 0 ? 1 : 0;
+            $info->save();
+        } catch (Exception $e) {
+            return $this->error($e->getMessage());
+        }
+        return $this->success([], '操作成功');
+    }
+
 }

+ 5 - 0
app/admin/model/Complaint.php

@@ -19,4 +19,9 @@ class Complaint extends BaseModel
         return $this->hasOne(ComplaintItem::class, 'id', 'complaint_item_id')->field(['id','level','name']);
     }
 
+    public function operation()
+    {
+        return $this->hasOne(Admin::class, 'id', 'operation_id')->field(['id','nickname']);
+    }
+
 }

+ 3 - 3
app/manage/controller/Config.php

@@ -44,10 +44,10 @@ class Config extends BaseController
     {
         $name = $this->request->param('name');
         $value = $this->request->param('value');
-        if(Conf::where(['name'=>$name])->find()){
-            Conf::where(['name'=>$name])->update(['value'=>$value]);
+        if(Conf::where(['field'=>$name])->find()){
+            Conf::where(['field'=>$name])->update(['val'=>$value]);
         }else{
-            Conf::create(['name'=>$name,'value'=>$value]);
+            Conf::create(['field'=>$name,'val'=>$value]);
         }
         if($name=='fileUpload'){
             updateEnv('driver',$value['disk']);