|
|
@@ -1152,6 +1152,16 @@ class Order extends BaseShop
|
|
|
$condition_desc[] = [ 'name' => 'order_id', 'value' => $order_ids ];
|
|
|
}
|
|
|
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "o.store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
+
|
|
|
//订单类型
|
|
|
$order_type_name = '全部';
|
|
|
if ($order_type != 'all') {
|
|
|
@@ -1267,7 +1277,7 @@ class Order extends BaseShop
|
|
|
|
|
|
$order_export_model = new OrderExport();
|
|
|
|
|
|
- $result = $order_export_model->orderExport($condition, $condition_desc, $this->site_id, $join ?? null, $is_verify, $order_label);
|
|
|
+ $result = $order_export_model->orderExport($condition, $condition_desc, $this->site_id, $join ?? null, $is_verify, $order_label,$userInfo['uid']);
|
|
|
return $result;
|
|
|
}
|
|
|
/**
|
|
|
@@ -1306,7 +1316,15 @@ class Order extends BaseShop
|
|
|
[ 'o.is_delete', '=', 0 ],
|
|
|
[ 'o.order_scene', '=', 'cashier' ]
|
|
|
];
|
|
|
-
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "o.store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
if (!empty($order_ids)) {
|
|
|
$condition[] = [ 'o.order_id', 'in', $order_ids ];
|
|
|
$condition_desc[] = [ 'name' => 'order_id', 'value' => $order_ids ];
|
|
|
@@ -1374,7 +1392,7 @@ class Order extends BaseShop
|
|
|
|
|
|
$order_export_model = new OrderExport();
|
|
|
|
|
|
- $result = $order_export_model->orderExport($condition, $condition_desc, $this->site_id, $join ?? null, $is_verify, $order_label);
|
|
|
+ $result = $order_export_model->orderExport($condition, $condition_desc, $this->site_id, $join ?? null, $is_verify, $order_label,$userInfo['uid']);
|
|
|
return $result;
|
|
|
}
|
|
|
/**
|
|
|
@@ -1518,7 +1536,15 @@ class Order extends BaseShop
|
|
|
} else {
|
|
|
$condition[] = [ 'm.nickname', 'like', '%' . $search_text . '%' ];
|
|
|
}
|
|
|
-
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "o.store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
if (addon_is_exit('store') == 1 && !empty($store_id)) {
|
|
|
$store_model = new StoreModel();
|
|
|
$store_info = $store_model->getStoreInfo([ [ 'store_id', '=', $store_id ] ], 'store_name')[ 'data' ];
|
|
|
@@ -1528,7 +1554,7 @@ class Order extends BaseShop
|
|
|
}
|
|
|
|
|
|
$order_export_model = new OrderExport();
|
|
|
- $result = $order_export_model->orderGoodsExport($condition, $condition_desc, $this->site_id, $is_verify, $order_label);
|
|
|
+ $result = $order_export_model->orderGoodsExport($condition, $condition_desc, $this->site_id, $is_verify, $order_label,$user_info['uid']);
|
|
|
return $result;
|
|
|
}
|
|
|
public function exportMoneyOrderGoods()
|
|
|
@@ -1677,9 +1703,17 @@ class Order extends BaseShop
|
|
|
$condition[] = [ 'o.store_id', '=', $store_id ];
|
|
|
$condition_desc[] = [ 'name' => '来源门店', 'value' => $store_info[ 'store_name' ] ];
|
|
|
}
|
|
|
-
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+// $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+// $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+// if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+// $condition[] = [ "o.store_id", "in", $store_id_arr];
|
|
|
+// }
|
|
|
$order_export_model = new OrderExport();
|
|
|
- $result = $order_export_model->orderGoodsExport($condition, $condition_desc, $this->site_id, $is_verify, $order_label);
|
|
|
+ $result = $order_export_model->orderGoodsExport($condition, $condition_desc, $this->site_id, $is_verify, $order_label,$userInfo['uid']);
|
|
|
return $result;
|
|
|
}
|
|
|
/**
|
|
|
@@ -2071,12 +2105,15 @@ class Order extends BaseShop
|
|
|
*/
|
|
|
public function export()
|
|
|
{
|
|
|
+ $user_info = $this->user_info;
|
|
|
+// var_dump($user_info);
|
|
|
if (request()->isAjax()) {
|
|
|
$page_index = input('page', 1);
|
|
|
$page_size = input('page_size', PAGE_LIST_ROWS);
|
|
|
$export_model = new OrderExport();
|
|
|
$condition = array (
|
|
|
- [ 'site_id', '=', $this->site_id ]
|
|
|
+ [ 'site_id', '=', $this->site_id ],
|
|
|
+ [ 'admin_user_id','=',$user_info['uid']]
|
|
|
);
|
|
|
$result = $export_model->getExportPageList($condition, $page_index, $page_size, 'create_time desc', '*');
|
|
|
return $result;
|