|
@@ -19,7 +19,7 @@ use think\App;class CatPlat extends Base{
|
|
|
if($catinfo==false){
|
|
|
return error_show(1004,"分类信息不存在");
|
|
|
}
|
|
|
- $plat_id =isset($post['plat_id'])&&$post['plat_id']!=="" ? intval($post['plat_id']):"";
|
|
|
+ $plat_id =isset($post['platform_id'])&&$post['platform_id']!=="" ? intval($post['platform_id']):"";
|
|
|
if($plat_id==""){
|
|
|
return error_show(1004,"参数 plat_id 不能为空");
|
|
|
}
|
|
@@ -61,9 +61,9 @@ use think\App;class CatPlat extends Base{
|
|
|
return error_show(1004,"分类未设置平台毛利率");
|
|
|
}
|
|
|
|
|
|
- $plat_id =isset($post['plat_id'])&&$post['plat_id']!=="" ? intval($post['plat_id']):"";
|
|
|
+ $plat_id =isset($post['platform_id'])&&$post['platform_id']!=="" ? intval($post['platform_id']):"";
|
|
|
if($plat_id==""){
|
|
|
- return error_show(1004,"参数 plat_id 不能为空");
|
|
|
+ return error_show(1004,"参数 platform_id 不能为空");
|
|
|
}
|
|
|
$platform = Db::name("platform")->where(["id"=>$plat_id,"is_del"=>0])->find();
|
|
|
if($platform==false){
|
|
@@ -97,8 +97,10 @@ use think\App;class CatPlat extends Base{
|
|
|
$condition = [["is_del","=",0]];
|
|
|
$catid= isset($post['cat_id'])&&$post['cat_id']!=""?intval($post['cat_id']) :"";
|
|
|
if($catid!="") $condition[]=["cat_id","=",$catid];
|
|
|
- $platid= isset($post['plat_id'])&&$post['plat_id']!=""?intval($post['plat_id']) :"";
|
|
|
- if($platid!="") $condition[]=["plat_id","=",$platid];
|
|
|
+ $platid= isset($post['platform_id'])&&$post['platform_id']!=""?intval($post['platform_id']) :"";
|
|
|
+ if($platid!="") $condition[]=["platform_id","=",$platid];
|
|
|
+ $status= isset($post['status'])&&$post['status']!==""?intval($post['status']) :"";
|
|
|
+ if($status!=="") $condition[]=["status","=",$status];
|
|
|
|
|
|
$count = Db::name("cat_plat")->where($condition)->count();
|
|
|
$total = ceil($count/$size);
|
|
@@ -186,7 +188,7 @@ use think\App;class CatPlat extends Base{
|
|
|
// //库存品的话,不足采购起订量的时候,取采购最小起订量
|
|
|
// if ($good['is_stock'] == 0) return error_show(1010, "起订量不足{$nakelist['min_num']}");
|
|
|
// }
|
|
|
- $catinfo = Db::name("cat_plat")->where(["cat_id"=>$good['cat_id'],"is_del"=>0,"plat_id"=>$platid])->find();
|
|
|
+ $catinfo = Db::name("cat_plat")->where(["cat_id"=>$good['cat_id'],"is_del"=>0,"platform_id"=>$platid])->find();
|
|
|
if ($catinfo==false) return error_show(1005,"分类未设置平台毛利率");
|
|
|
$budget = isset($catinfo['rate']) ? $catinfo['rate']/100:0;
|
|
|
$top_cat_id = made($catinfo['cat_id']);//获取所有分类
|