|
@@ -823,8 +823,11 @@ class Purchin extends Base
|
|
|
|
|
|
//需要在详情页把相关退货记录原样取出来,所以这里把if去掉,所有记录都入purchease_return表
|
|
|
// if($info['status']==5){
|
|
|
+ $returnCode=makeNo("CR");
|
|
|
$data=[
|
|
|
+ "returnCode"=>$returnCode,
|
|
|
"wsm_in_code"=>$incode,
|
|
|
+ "cgdNo"=>$cgdinfo['cgdNo'],
|
|
|
"wsm_num"=>$wsm_num,
|
|
|
"reissue_num"=>$reissue_num,
|
|
|
"return_num"=>$return_num,
|
|
@@ -999,6 +1002,47 @@ class Purchin extends Base
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public function returnList(){
|
|
|
+ $page = isset($this->post['page']) && $this->post['page'] !=="" ? intval($this->post['page']):"1";
|
|
|
+ $size = isset($this->post['size']) && $this->post['size'] !=="" ? intval($this->post['size']):"10";
|
|
|
+ $where = [['a.is_del',"=",0],['b.is_del',"=",0]];
|
|
|
+ $cgdNo = isset($this->post['cgdNo']) && $this->post['cgdNo']!="" ? trim($this->post['cgdNo']):"";
|
|
|
+ if($cgdNo!=""){
|
|
|
+ $where[]=['a.cgdNo',"like", "%$cgdNo%"];
|
|
|
+ }
|
|
|
+ $returnCode= isset($this->post['returnCode']) && $this->post['returnCode']!="" ? trim($this->post['returnCode']):"";
|
|
|
+ if($returnCode!=""){
|
|
|
+ $where[]=['a.returnCode',"like", "%$returnCode%"];
|
|
|
+ }
|
|
|
+ $good_type_code=isset($this->post['good_type_code']) && $this->post['good_type_code']!==""? trim($this->post['good_type_code']):"";
|
|
|
+ if($good_type_code !=""){
|
|
|
+ $where[]= ["b.spuCode",'like',"%$good_type_code%"];
|
|
|
+ }
|
|
|
+ $good_name=isset($this->post['good_name']) && $this->post['good_name']!==""? trim($this->post['good_name']):"";
|
|
|
+ if($good_name !=""){
|
|
|
+ $where[]= ["b.good_name",'like',"%$good_name%"];
|
|
|
+ }
|
|
|
+ $status=isset($this->post['status']) && $this->post['status']!==""? trim($this->post['status']):"";
|
|
|
+ if($status!=""){
|
|
|
+ $where[]= ["a.status",'=',$status];
|
|
|
+ }
|
|
|
+ $count = Db::name('purchease_return')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->where($where)->count();
|
|
|
+ $total = ceil($count / $size);
|
|
|
+ $page = $page >= $total ? $total : $page;
|
|
|
+ $list = Db::name('purchease_return')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->where($where)->page($page,$size)
|
|
|
+ ->field("a.returnCode,b.spuCode,a.good_catid,a.return_num,a.good_price,a.good_total,
|
|
|
+ a.post_company,a.post_fee,a.status,a.cgdNo,b.good_name,b.order_type")->order("a.addtime desc")->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $value['can']= isset($value['good_catid']) && $value['good_catid'] !=0 ? made($value['good_catid']):[];
|
|
|
+ $data[]=$value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// public function ReturnStatus(){
|
|
|
// $incode = isset($this->post['wsm_in_code'])&&$this->post['wsm_in_code']!="" ? trim($this->post['wsm_in_code']) :"";
|
|
|
// if($incode==""){
|