|
@@ -61,8 +61,9 @@ use App\Model\Riddle;
|
|
|
use App\Model\Idiom;
|
|
|
use App\Model\WhiteRouter;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
-use App\Model\Company;
|
|
|
|
|
|
+use App\Model\Company;
|
|
|
+use Hyperf\Paginator\Paginator;
|
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class NewsService implements NewsServiceInterface
|
|
|
{
|
|
@@ -6092,47 +6093,87 @@ class NewsService implements NewsServiceInterface
|
|
|
*/
|
|
|
public function getWebsiteCompany(array $data): array
|
|
|
{
|
|
|
- $job = JobRecruiting::where('job_recruiting.website_id', $data['website_id'])
|
|
|
- ->where('job_recruiting.status', 1)
|
|
|
- ->where('job_recruiting.id', $data['id'])
|
|
|
- ->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
|
- ->select('job_company.*')
|
|
|
- ->first();
|
|
|
- if(empty($job)){
|
|
|
+ $where['website_id'] = $data['website_id'];
|
|
|
+ $where['status'] = 1;
|
|
|
+ if(isset($data['category_id']) && !empty($data['category_id'])){
|
|
|
+ $where['category_id'] = $data['category_id'];
|
|
|
+ }
|
|
|
+ if(isset($data['level']) && !empty($data['level'])){
|
|
|
+ $where['level'] = $data['level'];
|
|
|
+ }
|
|
|
+ // return Result::success($where);
|
|
|
+ $query = Company::where($where);
|
|
|
+ $result['img'] = $this->processArticle(
|
|
|
+ $query->clone()
|
|
|
+ ->where('imgurl','!=', '')
|
|
|
+ ->whereNotNull('imgurl')
|
|
|
+ ->select('id','imgurl','title','introduce','description','content','category_id','cat_arr_id')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit($data['imgnum'])
|
|
|
+ ->get(),
|
|
|
+ $data
|
|
|
+ );
|
|
|
+
|
|
|
+ $result['text'] = $this->processArticle(
|
|
|
+ $query->clone()
|
|
|
+ ->select('id','title','introduce','description','content','category_id','cat_arr_id')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit($data['textnum'])
|
|
|
+ ->get(),
|
|
|
+ $data
|
|
|
+ );
|
|
|
+ if(empty($result)){
|
|
|
return Result::error("暂无相关公司信息", 0);
|
|
|
}
|
|
|
- return Result::success($job['company_id']);
|
|
|
+ return Result::success($result);
|
|
|
}
|
|
|
/**
|
|
|
* @param array $data
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getWebsiteCompanyInfo(array $data): array
|
|
|
+ public function getWebsiteCompanyList(array $data): array
|
|
|
{
|
|
|
- $job = JobCompany::where('job_company.website_id', $data['website_id'])
|
|
|
- ->where('job_company.status', 1)
|
|
|
- ->where('job_company.id', $data['id'])
|
|
|
- ->select('job_company.*')
|
|
|
- ->first();
|
|
|
- if(empty($job)){
|
|
|
+ $where['website_id'] = $data['website_id'];
|
|
|
+ $where['status'] = 1;
|
|
|
+ if(isset($data['category_id']) && !empty($data['category_id'])){
|
|
|
+ $where['category_id'] = $data['category_id'];
|
|
|
+ }
|
|
|
+ if(isset($data['keyword']) && !empty($data['keyword'])){
|
|
|
+ array_push($where, ['title', 'like', '%' . $data['keyword'] . '%']);
|
|
|
+ }
|
|
|
+ $query = Company::where($where);
|
|
|
+ $company = $this->processArticle(
|
|
|
+ $query->select('id','title','introduce','description','content','category_id','cat_arr_id')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
+ ->limit($data['pageSize'])
|
|
|
+ ->get(),
|
|
|
+ $data
|
|
|
+ );
|
|
|
+ if(empty($company)){
|
|
|
return Result::error("暂无相关公司信息", 0);
|
|
|
}
|
|
|
- return Result::success($job);
|
|
|
+ $result = [
|
|
|
+ 'count' => $query->clone()->count(),
|
|
|
+ 'data' => $company,
|
|
|
+ ];
|
|
|
+ return Result::success($result);
|
|
|
}
|
|
|
/**
|
|
|
* @param array $data
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getWebsiteCompanyList(array $data): array
|
|
|
+ public function getWebsiteCompanyInfo(array $data): array
|
|
|
{
|
|
|
- $job = JobCompany::where('job_company.website_id', $data['website_id'])
|
|
|
- ->where('job_company.status', 1)
|
|
|
- ->select('job_company.*')
|
|
|
- ->get();
|
|
|
- if(empty($job)){
|
|
|
+ $company = Company::where('id', $data['id'])
|
|
|
+ ->where('status', 1)
|
|
|
+ ->where('website_id', $data['website_id'])
|
|
|
+ ->select('company.*')
|
|
|
+ ->first();
|
|
|
+ if(empty($company)){
|
|
|
return Result::error("暂无相关公司信息", 0);
|
|
|
}
|
|
|
- return Result::success($job);
|
|
|
+ return Result::success($company);
|
|
|
}
|
|
|
|
|
|
|