|
|
@@ -40,6 +40,7 @@ class PriorityService extends Service
|
|
|
$model->code = $value['code'];
|
|
|
$model->type = $value['type'];
|
|
|
$model->sort = $value['sort'];
|
|
|
+ $model->is_use = $value['is_use'];
|
|
|
$model->top_depart_id = $value['top_depart_id'];
|
|
|
$model->save();
|
|
|
}
|
|
|
@@ -73,26 +74,25 @@ class PriorityService extends Service
|
|
|
|
|
|
if(! empty($data['title'])) $model->where('title', 'LIKE', '%'.$data['title'].'%');
|
|
|
if(! empty($data['code'])) $model->where('code', 'LIKE', '%'.$data['code'].'%');
|
|
|
+ if(isset($data['is_use'])) $model->where('is_use', $data['is_use']);
|
|
|
|
|
|
return $model;
|
|
|
}
|
|
|
|
|
|
public function priorityList($data, $user){
|
|
|
$model = $this->priorityCommon($data, $user);
|
|
|
-
|
|
|
- $list = $model->get()->toArray();
|
|
|
+ $list = $this->limit($model,'',$data);
|
|
|
$list = $this->fillPriorityList($list, $user);
|
|
|
|
|
|
return [true, $list];
|
|
|
}
|
|
|
|
|
|
- public function fillPriorityList($list, $user, $is_export = false){
|
|
|
+ public function fillPriorityList($list, $user){
|
|
|
if(empty($list)) return $list;
|
|
|
|
|
|
- if($is_export){
|
|
|
- foreach ($list['data'] as $key => $value){
|
|
|
- $list['data'][$key]['type_title'] = Priority::TYPE_TITLE[$value['type']] ?? "";
|
|
|
- }
|
|
|
+ foreach ($list['data'] as $key => $value){
|
|
|
+ $list['data'][$key]['type_title'] = Priority::TYPE_TITLE[$value['type']] ?? "";
|
|
|
+ $list['data'][$key]['is_use_title'] = Priority::IS_USE[$value['is_use']] ?? "";
|
|
|
}
|
|
|
|
|
|
return $list;
|