wugg 1 рік тому
батько
коміт
ab171aca91

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

@@ -48,7 +48,7 @@ class After extends Base
         if (empty($orderout)) return error_show(1005, "未找到发货单数据");
 
         $after_num = Db::name("order_return")
-            ->where(["orderCode" => $orderout['orderCode'], "outCode" => $param['outCode']])
+            ->where(["orderCode" => $orderout['orderCode'], "outCode" => $param['outCode'], 'is_del' => 0])
             ->where("status", "not in", [5, 6, 8])
             ->sum("error_num");
 

+ 8 - 3
app/admin/controller/CombindStock.php

@@ -20,17 +20,22 @@ class CombindStock extends Base
 	}
  
 	public function list(){
-		$param=$this->request->only(['spuCode'=>'','wsm_code'=>'','good_name'=>'','cat_id'=>'','status'=>'','flag'=>'',
+		$param=$this->request->only(['spuCode'=>'','wsm_code'=>'','good_name'=>'','cat_id'=>'','status'=>'','flag'=>'','companyNo'=>'','companyName'=>'',
 		"create_start"=>"2023-01-01 00:00:00","create_end"=>date("Y-m-d H:i:s"),"page"=>1,"size"=>15],'post','trim');
 		$where=[["combind_stock.createtime","between",[$param['create_start']?:  '2023-01-01 00:00:00',$param['create_end']?: date("Y-m-d H:i:s")]]];
 		$param['spuCode']==''?:$where[]=["combind_stock.spuCode","like","%{$param['spuCode']}%"];
 		$param['wsm_code']==''?:  $where[]=["combind_stock.wsm_code","like","%{$param['wsm_code']}%"];
 		$param['good_name']==''?: $where[]=["combind_stock.good_name","like","%{$param['good_name']}%"];
+		$param['companyNo']==''?: $where[]=["good.companyNo","like","%{$param['companyNo']}%"];
+		$param['companyName']==''?: $where[]=["good.companyName","like","%{$param['companyName']}%"];
 		$param['cat_id']==''?:  $where[]=["good.cat_id","=",$param['cat_id']];
 		$param['flag']==''?:  $where[]=["combind_stock.flag","=",$param['flag']];
 		$param['status']==''?:  $where[]=["combind_stock.status","=",$param['status']];
-		$list = $this->combindStock->alias("a")->withJoin(["wsminfo","good"],"left")->where($where)->order("id desc")->paginate
-		(["page"=>$param['page'],"list_rows"=>$param['size']]);
+		$list = $this->combindStock
+		->alias("a")
+		->withJoin(["wsminfo","good"],"left")
+		->where($where)->order("id desc")
+		->paginate(["page"=>$param['page'],"list_rows"=>$param['size']]);
 
 		return app_show(0,"获取成功",["list"=>$list->items(),"count"=>$list->total()]);
 		

+ 1 - 1
app/admin/model/CombindBninfo.php

@@ -83,7 +83,7 @@ class CombindBninfo extends Model
         	if($save==false) throw new \Exception('bn库存数据更新失败');
         	 $good = $goodinfo->where(['spuCode'=>$item['childCode']])->findOrEmpty();
 			 if($good->isEmpty()==false){
-			 	$good->usable_stock = bcadd($good->usable_stock,intval($item['childBnNum']));
+			 	$good->usable_stock = bcadd($good->usable_stock,$item['childBnNum']);
 			 	$gdup=$good->save();
 			 	if($gdup==false)throw new \Exception('子商品库存更新失败');
 			 }

+ 1 - 1
app/admin/model/CombindStock.php

@@ -17,7 +17,7 @@ class CombindStock extends Model
    
    protected $append=["specInfo","catInfo"];
    public function good(){
-   	    return $this->belongsTo(GoodBasic::class,"spuCode","spuCode")->bind(["cat_id"]);
+   	    return $this->belongsTo(GoodBasic::class,"spuCode","spuCode")->bind(["cat_id","companyNo","companyName"]);
    }
    
    public function WsmInfo(){