|
@@ -1033,13 +1033,18 @@ class Purch extends Base
|
|
|
|
|
|
$order_source = $order_source = isset($this->post['order_source']) && $this->post['order_source'] != "" ? intval($this->post['order_source']) : "";
|
|
|
if ($order_source !== "") $where[] = ['c.order_source', "=", $order_source];
|
|
|
- $is_stock = $order_source = isset($this->post['is_stock']) && $this->post['is_stock'] != "" ? intval($this->post['is_stock']) : "";
|
|
|
- if ($is_stock !== "") $where[] = ['b.is_stock', "=", $is_stock];
|
|
|
|
|
|
+ $order_type = $order_source = isset($this->post['order_type']) && $this->post['order_type'] != "" ? intval($this->post['order_type']) : "";
|
|
|
+ if ($order_type !== "") $where[] = ['c.order_type', "=", $order_type];
|
|
|
|
|
|
// $role = $this->checkDataShare();
|
|
|
// if (!empty($role[DataGroupModel::$type_全部])) $where[] = ['a.apply_id', 'in', $role[DataGroupModel::$type_全部]];
|
|
|
- $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo']!="" ? trim($this->post['relaComNo']):"";
|
|
|
+ $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo'] != "" ? trim($this->post['relaComNo']) : "";
|
|
|
+ if ($relaComNo != '') $where[] = ['b.companyNo', '=', $relaComNo];
|
|
|
+
|
|
|
+ $supplierNo = isset($this->post['supplierNo']) && $this->post['supplierNo'] != "" ? trim($this->post['supplierNo']) : "";
|
|
|
+ if ($supplierNo != '') $where[] = ['b.supplierNo', '=', $supplierNo];
|
|
|
+
|
|
|
if ($this->level == 2) {
|
|
|
$role = $this->checkDataShare();
|
|
|
$hand = resign_hand_user($this->uid, 0);
|
|
@@ -1047,11 +1052,11 @@ class Purch extends Base
|
|
|
$arr = array_unique(array_merge($hand, $role[DataGroupModel::$type_全部]));
|
|
|
$where[] = ['a.apply_id', 'in', $arr];
|
|
|
}
|
|
|
- if($relaComNo!='') $where[]=['b.companyNo','=', $relaComNo];
|
|
|
+// if($relaComNo!='') $where[]=['b.companyNo','=', $relaComNo];
|
|
|
}
|
|
|
- if($this->level==3){
|
|
|
- if($relaComNo!='') $where[]=['b.supplierNo','=', $relaComNo];
|
|
|
- }
|
|
|
+// if($this->level==3){
|
|
|
+// if($relaComNo!='') $where[]=['b.supplierNo','=', $relaComNo];
|
|
|
+// }
|
|
|
|
|
|
$count = Db::name('purchease_diff')
|
|
|
->alias('a')
|
|
@@ -1068,7 +1073,7 @@ class Purch extends Base
|
|
|
->where($where)
|
|
|
->page($page,$size)
|
|
|
->order("a.addtime desc")
|
|
|
- ->field("a.*,b.cat_id,c.order_source,b.is_stock")
|
|
|
+ ->field("a.*,b.cat_id,c.order_source,c.order_type")
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|