wugg 10 months ago
parent
commit
a5ba2540d8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/admin/model/CompanyCatProfit.php

+ 2 - 2
app/admin/model/CompanyCatProfit.php

@@ -13,7 +13,7 @@ class CompanyCatProfit extends Model
     public function GetRate($companyNo,$cat_id,$field){
         $rate=$this->where(["companyNo"=>$companyNo,"cat_id"=>$cat_id])->value($field,0);
         if($rate==0){
-        	$parent = $this->name("cat")->where(["id"=>$cat_id])->value("parent_id",0);
+        	$parent = $this->name("cat")->where(["id"=>$cat_id])->value("pid",0);
         	if($parent>0)$rate=$this->GetRate($companyNo,$parent,$field);
         }
         return $rate;
@@ -22,7 +22,7 @@ class CompanyCatProfit extends Model
      public function GetAllRate($companyNo,$cat_id){
         $rate=$this->where(['companyNo'=>$companyNo,'cat_id'=>$cat_id])->findOrEmpty();
         if($rate->isEmpty()){
-        	$parent = $this->name('cat')->where(['id'=>$cat_id])->value('parent_id',0);
+        	$parent = $this->name('cat')->where(['id'=>$cat_id])->value('pid',0);
         	if($parent>0)$rate=$this->GetAllRate($companyNo,$parent);
         }
         return $rate;