|
|
|
@ -12,6 +12,7 @@ |
|
|
|
namespace app\service\api\apiService; |
|
|
|
|
|
|
|
use app\model\campus_person_role\CampusPersonRole; |
|
|
|
use app\model\customer_resources\CustomerResources; |
|
|
|
use app\model\order_table\OrderTable; |
|
|
|
use app\model\resource_sharing\ResourceSharing; |
|
|
|
use core\base\BaseApiService; |
|
|
|
@ -47,8 +48,25 @@ class ResourceSharingService extends BaseApiService |
|
|
|
->distinct(true) |
|
|
|
->column('person_id'); |
|
|
|
|
|
|
|
$resource_id_arr = [];//客户资源表id |
|
|
|
//客户资源表名字 |
|
|
|
if(!empty($where['name'])){ |
|
|
|
$resource_id = (new CustomerResources())->where('name', 'like', "%{$where['name']}%")->column('id'); |
|
|
|
$resource_id_arr = array_merge($resource_id_arr,$resource_id); |
|
|
|
} |
|
|
|
//客户资源表手机号 |
|
|
|
if(!empty($where['phone_number'])){ |
|
|
|
$resource_id = (new CustomerResources())->where('phone_number', 'like', "%{$where['phone_number']}%")->column('id'); |
|
|
|
$resource_id_arr = array_merge($resource_id_arr,$resource_id); |
|
|
|
} |
|
|
|
//去重 |
|
|
|
$resource_id_arr = array_unique($resource_id_arr); |
|
|
|
|
|
|
|
$model = $this->model; |
|
|
|
|
|
|
|
if($resource_id_arr){ |
|
|
|
$model = $model->whereIn('resource_id',$resource_id_arr); |
|
|
|
} |
|
|
|
|
|
|
|
if ((!empty($where['shared_by']) || isset($where['shared_by'])) && $where['shared_by'] !== '') { |
|
|
|
$model = $model->where('shared_by', $where['shared_by']); |
|
|
|
|