panlumeng 3 years ago
parent
commit
d5113f86bc

+ 11 - 0
app/admin/controller/Cat.php

@@ -332,4 +332,15 @@ public function status(){
         return error_show(1002,"状态更新失败");
     }
 }
+public function delete(){
+    $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']):"";
+    if($id==""){
+        return error_show(1002,"参数id不能为空");
+    }
+    $info = Db::name('cat')->where(['id'=>$id,['is_del'=>0]])->find();
+    if($info==""){
+        return error_show(1002,"未找到数据");
+    }
+
+}
 }

+ 22 - 0
app/admin/controller/Customar.php

@@ -309,4 +309,26 @@ class Customar extends BaseController
             return error_show(1002,"删除失败");
         }
     }
+    public function status(){
+        $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']):"";
+        if($id==""){
+            return error_show(1002,"参数id不能为空");
+        }
+        $info =  Db::name("customer_member")->where([["id","=",$id],["is_del","=",0]])->find();
+        if(!$info){
+            return error_show(1002,"未找到对应数据");
+        }
+        $status =  isset($this->post['status']) && $this->post['status']!==""? intval($this->post['status']):"";
+        if($status===""){
+            return error_show(1002,"参数status不能为空");
+        }
+        if(!in_array($status,[0,1])){
+            return error_show(1002,"参数status无效");
+        }
+        $info['status']=$status;
+        $msg = $status==1?"启用":"禁用";
+        $update = Db::name("customer_member")->save($info);
+        return  $update? error_show(0,"{$msg}成功"):error_show(1004,"{$msg}失败");
+
+    }
 }

+ 3 - 3
app/admin/controller/Goldprice.php

@@ -37,7 +37,7 @@ class Goldprice extends BaseController
         if($type==""){
             return error_show(1002,"参数type不能为空");
         }
-        $price = isset($this->post['price']) && $this->post['price'] !=="" ? intval($this->post['price']):"";
+        $price = isset($this->post['price']) && $this->post['price'] !=="" ? floatval($this->post['price']):"";
         if($price==""){
             return error_show(1002,"参数price不能为空");
         }
@@ -133,7 +133,7 @@ class Goldprice extends BaseController
             return error_show(1002,"参数status无效");
         }
         $info['status']=$status;
-        $msg = $status==0?"启用":"禁用";
+        $msg = $status==1?"启用":"禁用";
         $update = Db::name("gold_price1")->save($info);
         return  $update? error_show(0,"{$msg}成功"):error_show(1004,"{$msg}失败");
     }
@@ -150,7 +150,7 @@ class Goldprice extends BaseController
         if($type==""){
             return error_show(1002,"参数type不能为空");
         }
-        $price = isset($this->post['price']) && $this->post['price'] !=="" ? intval($this->post['price']):"";
+        $price = isset($this->post['price']) && $this->post['price'] !=="" ? floatval($this->post['price']):"";
         if($price==""){
             return error_show(1002,"参数price不能为空");
         }

+ 1 - 0
app/admin/route/app.php

@@ -315,6 +315,7 @@ Route::rule('customarlist','admin/Customar/list');
 Route::rule('customaredit','admin/Customar/edit');
 Route::rule('customarinfo','admin/Customar/info');
 Route::rule('customardelete','admin/Customar/del');
+Route::rule('customarstatus','admin/Customar/status');
 
 Route::rule('businesscreate','admin/Business/create');
 Route::rule('businesslist','admin/Business/list');