|
@@ -4,6 +4,7 @@ namespace App\Service;
|
|
|
|
|
|
use App\Model\BasicType;
|
|
|
use App\Model\Depart;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
/**
|
|
|
* 基础分类设置相关
|
|
@@ -62,7 +63,23 @@ class BasicTypeService extends Service
|
|
|
public function basicTypeList($data, $user){
|
|
|
$model = BasicType::TopClear($user,$data);
|
|
|
$model = $model->where('del_time',0)
|
|
|
- ->select('title','id','type','code')
|
|
|
+ ->select('title','id','type','code','top_depart_id')
|
|
|
+ ->orderby('id', 'asc');
|
|
|
+
|
|
|
+ if(! empty($data['type'])) $model->where('type',$data['type']);
|
|
|
+ if(! empty($data['title'])) $model->where('title', 'LIKE', '%'.$data['title'].'%');
|
|
|
+
|
|
|
+ $list = $this->limit($model,'',$data);
|
|
|
+ $list = $this->fillData($list);
|
|
|
+
|
|
|
+ return [true, $list];
|
|
|
+ }
|
|
|
+
|
|
|
+ public function basicTypeCustomerList($data, $user){
|
|
|
+ $data['top_depart_id'] = $user['head']['id'];
|
|
|
+ $model = BasicType::TopClear($user,$data);
|
|
|
+ $model = $model->where('del_time',0)
|
|
|
+ ->select('title','id','type','code','top_depart_id')
|
|
|
->orderby('id', 'asc');
|
|
|
|
|
|
if(! empty($data['type'])) $model->where('type',$data['type']);
|