|
|
@@ -1342,19 +1342,25 @@ class Customer extends Base
|
|
|
|
|
|
}
|
|
|
$owner_staff_id = $wheres['owner_staff_id'];
|
|
|
+ $owner_staff_id_arr = explode(',',$owner_staff_id);
|
|
|
+ foreach ($owner_staff_id_arr as $k=>$v){
|
|
|
+ if($k==0){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
unset($wheres['owner_staff_id']);
|
|
|
$list = $this->model->where($where)->with(['ownerStaff','customerOther'])
|
|
|
->where($wheres)
|
|
|
- ->where(function ($query) use ($staff_id, $owner_staff_id, $type) {
|
|
|
- if ($type == 0) {//全部
|
|
|
- $query->where(['ro_staff_id' => ['like', "%,{$staff_id},%"]])
|
|
|
- ->whereOr('rw_staff_id', 'like', "%,{$staff_id},%")
|
|
|
- ->whereOr(['owner_staff_id' => $owner_staff_id]);
|
|
|
- } else {
|
|
|
- $query->where(['owner_staff_id' => $owner_staff_id]);
|
|
|
- }
|
|
|
- })
|
|
|
- ->where('owner_staff_id != 0 and owner_staff_id is not null')->order($sort, $order)->fetchSql()->select();
|
|
|
+// ->where(function ($query) use ($staff_id, $owner_staff_id, $type) {
|
|
|
+// if ($type == 0) {//全部
|
|
|
+// $query->where(['ro_staff_id' => ['like', "%,{$staff_id},%"]])
|
|
|
+// ->whereOr('rw_staff_id', 'like', "%,{$staff_id},%")
|
|
|
+// ->whereOr(['owner_staff_id' => $owner_staff_id]);
|
|
|
+// } else {
|
|
|
+// $query->where(['owner_staff_id' => $owner_staff_id]);
|
|
|
+// }
|
|
|
+// })
|
|
|
+ ->where('owner_staff_id != 0 and owner_staff_id is not null')->order($sort, $order)->select();
|
|
|
outFileLog($list,'customer','list-export-sql');
|
|
|
$list = collection($list)->toArray();
|
|
|
outFileLog($list,'customer','list-export');
|