|
|
@@ -43,7 +43,22 @@ class LabelsLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取数据权限
|
|
|
+ * $this->adminInfo['data_rules']
|
|
|
+ * province city admin_id sale_group_id sale_id property_head_id
|
|
|
+ */
|
|
|
+ public function queryDataWhere(){
|
|
|
+ $where = [];
|
|
|
+ $data_rules = $this->adminInfo['data_rules'];
|
|
|
+ if (isset($data_rules['province']) && !empty($data_rules['province'])) {
|
|
|
+ $where[] = ['province','in' ,$data_rules['province']];
|
|
|
+ }
|
|
|
+ if (isset($data_rules['city']) && !empty($data_rules['city'])) {
|
|
|
+ $where[] = ['city','in' ,$data_rules['city']];
|
|
|
+ }
|
|
|
+ return $where;
|
|
|
+ }
|
|
|
/**
|
|
|
* @notes 获取列表
|
|
|
* @return array
|
|
|
@@ -56,7 +71,8 @@ class LabelsLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
public function lists(): array
|
|
|
{
|
|
|
return Labels::where($this->searchWhere)
|
|
|
- ->field(['id', 'label_type', 'label_name','pid'])
|
|
|
+ ->field(['id', 'label_type', 'label_name','pid','province','city','area_name'])
|
|
|
+ ->where($this->queryDataWhere())
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['id' => 'desc'])
|
|
|
->select()
|
|
|
@@ -72,7 +88,7 @@ class LabelsLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
*/
|
|
|
public function count(): int
|
|
|
{
|
|
|
- return Labels::where($this->searchWhere)->count();
|
|
|
+ return Labels::where($this->searchWhere)->where($this->queryDataWhere())->count();
|
|
|
}
|
|
|
|
|
|
}
|