|
@@ -164,14 +164,23 @@ class Sale extends BaseController
|
|
if($orderCode !==""){
|
|
if($orderCode !==""){
|
|
$where[]=['orderCode',"=",$orderCode];
|
|
$where[]=['orderCode',"=",$orderCode];
|
|
}
|
|
}
|
|
|
|
+ $ordertype=isset($this->post['order_type']) && $this->post['order_type'] !=="" ? intval($this->post['order_type'])
|
|
|
|
+ :"";
|
|
|
|
+ if($ordertype !==""){
|
|
|
|
+ $where[]=['order_type',"=",$ordertype];
|
|
|
|
+ }
|
|
$status=isset($this->post['status']) && $this->post['status'] !=="" ? trim($this->post['status']):"";
|
|
$status=isset($this->post['status']) && $this->post['status'] !=="" ? trim($this->post['status']):"";
|
|
if($status !==""){
|
|
if($status !==""){
|
|
$where[]=['status',"=",$status];
|
|
$where[]=['status',"=",$status];
|
|
}
|
|
}
|
|
- $addtime = isset($this->post['addtime']) && $this->post['addtime'] !=="" ? $this->post['addtime'] :"";
|
|
|
|
- if($addtime !=""){
|
|
|
|
- $where[]= ["addtime",'<=',$addtime];
|
|
|
|
|
|
+ $start = isset($this->post['start']) && $this->post['start'] !=="" ? $this->post['start'] :"";
|
|
|
|
+ if($start !=""){
|
|
|
|
+ $where[]= ["addtime",'>=',$start];
|
|
}
|
|
}
|
|
|
|
+ $end = isset($this->post['end']) && $this->post['end'] !=="" ? $this->post['end'] :"";
|
|
|
|
+ if($end !=""){
|
|
|
|
+ $where[]= ["addtime",'<=',$end];
|
|
|
|
+ }
|
|
$count = Db::name('sale')->where($where)->count();
|
|
$count = Db::name('sale')->where($where)->count();
|
|
$total = ceil($count/$size);
|
|
$total = ceil($count/$size);
|
|
$page = $page >= $total ? $total : $page;
|
|
$page = $page >= $total ? $total : $page;
|
|
@@ -706,7 +715,7 @@ class Sale extends BaseController
|
|
public function difflist(){
|
|
public function difflist(){
|
|
$page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']):"1";
|
|
$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";
|
|
$size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']):"10";
|
|
- $where = [['a.is_del',"=",0]];
|
|
|
|
|
|
+ $where = [];
|
|
$cgdNo = isset($this->post['orderCode']) && $this->post['orderCode']!="" ? trim($this->post['orderCode']):"";
|
|
$cgdNo = isset($this->post['orderCode']) && $this->post['orderCode']!="" ? trim($this->post['orderCode']):"";
|
|
if($cgdNo!=""){
|
|
if($cgdNo!=""){
|
|
$where[]=['a.orderCode',"like", "%$cgdNo%"];
|
|
$where[]=['a.orderCode',"like", "%$cgdNo%"];
|
|
@@ -823,7 +832,7 @@ class Sale extends BaseController
|
|
return error_show(1004,"参数id不能为空");
|
|
return error_show(1004,"参数id不能为空");
|
|
}
|
|
}
|
|
$info = Db::name('sale_diff')->alias('a')->join("good b","b.good_code=a.good_kode","left")->where
|
|
$info = Db::name('sale_diff')->alias('a')->join("good b","b.good_code=a.good_kode","left")->where
|
|
- (["a.id"=>$id])->field("a,*,b.cat_id")->find();
|
|
|
|
|
|
+ (["a.id"=>$id])->field("a.*,b.cat_id")->find();
|
|
if(empty($info)){
|
|
if(empty($info)){
|
|
return error_show(1004,"订单数据未找到");
|
|
return error_show(1004,"订单数据未找到");
|
|
}
|
|
}
|