|
@@ -5801,6 +5801,7 @@ class NewsService implements NewsServiceInterface
|
|
|
*/
|
|
|
public function getCompanyList(array $data): array
|
|
|
{
|
|
|
+ // return Result::success($data);
|
|
|
$where = [];
|
|
|
$user = User::where('id', $data['user_id'])->first();
|
|
|
if(empty($user)){
|
|
@@ -5809,18 +5810,23 @@ class NewsService implements NewsServiceInterface
|
|
|
if($user['type_id']!= 10000){
|
|
|
$where['user_id'] = $data['user_id'];
|
|
|
}
|
|
|
- if(isset($data['title']) && $data['title']){
|
|
|
+ if(isset($data['title']) && !empty($data['title'])){
|
|
|
array_push($where, ['company.title', 'like', '%'. $data['title']. '%']);
|
|
|
}
|
|
|
- if(isset($data['website_id']) && $data['website_id']){
|
|
|
- $where['company.website_id'] = $data['website_id'];
|
|
|
+ if(isset($data['website_name']) && !empty($data['website_name'])){
|
|
|
+ array_push($where, ['website.website_name', 'like', '%'. $data['website_name']. '%']);
|
|
|
}
|
|
|
if(isset($data['ischeck']) && !empty($data['ischeck'])){
|
|
|
- if($data['ischeck'] == 1){
|
|
|
+ if($data['ischeck'] == 1){
|
|
|
+ if(isset($data['status']) && $data['status'] != ''){
|
|
|
+ array_push($where, ['company.status', $data['status']]);
|
|
|
+ $query = Company::where($where);
|
|
|
+ }else{
|
|
|
$query = Company::whereIn('company.status', [0,2]);
|
|
|
- }else{
|
|
|
- $query = Company::where('company.status', 1);
|
|
|
- }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $query = Company::where('company.status', 1);
|
|
|
+ }
|
|
|
}
|
|
|
$result = $query->where($where)
|
|
|
->leftJoin('website_category', function ($query) {
|