wugg 1 year ago
parent
commit
65a635be30
1 changed files with 4 additions and 9 deletions
  1. 4 9
      app/admin/controller/Keepbrand.php

+ 4 - 9
app/admin/controller/Keepbrand.php

@@ -89,15 +89,10 @@ class Keepbrand extends Base
         if(!$info) {
             return error_show(1002, "未找到对应数据");
         }
-        $data = Db::name("brand")->alias('a')
-            ->join("brand_book b","b.brand_id=a.id")
-            ->field("b.*,a.brand_name")
-            ->where(["b.id"=>$info['brand_id']])->find();
-        if($data){
-            return app_show(0,"获取成功",$data);
-        }else{
-            return app_show(1002,"获取失败",$data);
-        }
+		$info['brand_name'] = Db::name("brand")->where(["id"=>$info['brand_id']])->value("brand_name",'');
+        
+            return app_show(0,"获取成功",$info);
+        
     }
     public function status(){
         $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']):"";