|
...
|
...
|
@@ -7,6 +7,8 @@ use App\Helper\Arr; |
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\User\UserLogic;
|
|
|
|
use App\Jobs\PurchaserJob;
|
|
|
|
use App\Models\Com\Purchaser;
|
|
|
|
use App\Models\CustomModule\CustomModule;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\Project;
|
|
...
|
...
|
@@ -15,6 +17,7 @@ use App\Models\User\ProjectMenu as ProjectMenuModel; |
|
|
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
|
|
use App\Models\User\User;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
|
|
|
|
/***
|
|
|
|
* 当前为公共类
|
|
...
|
...
|
@@ -333,22 +336,14 @@ class ComController extends BaseController |
|
|
|
* @time :2024/3/4 10:10
|
|
|
|
*/
|
|
|
|
public function recommendedPurchaser(){
|
|
|
|
$this->param['keyword'] = 'led';
|
|
|
|
$url = 'https://admin.hagro.cn/api/company_list';
|
|
|
|
$data = [
|
|
|
|
'prod_desc'=>$this->param['keyword'],
|
|
|
|
'total'=>$this->param['now'] ?? 10,
|
|
|
|
];
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(http_build_query($data), true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$token = 'company_list'.date('Y-m-d').http_build_query(arsort($data));
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$param = [
|
|
|
|
'prod_desc'=>$this->param['keyword'],
|
|
|
|
'token'=>$token,
|
|
|
|
'total'=>$this->param['now'] ?? 10,
|
|
|
|
];
|
|
|
|
$lists = http_post($url,$param);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
$data = [];
|
|
|
|
$purchaserModel = new Purchaser();
|
|
|
|
$info = $purchaserModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
if($info === false){
|
|
|
|
PurchaserJob::dispatch(['keyword'=>$this->param['keyword'] ?? 'led','row'=>$this->param['row'] ?? 10,'project_id'=>$this->user['project_id']]);
|
|
|
|
}else{
|
|
|
|
$data = json_decode($info['data']);
|
|
|
|
}
|
|
|
|
$this->response('数据生成中',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|