作者 李宇航

合并分支 'master-server' 到 'master'

修改推荐供应商



查看合并请求 !640
... ... @@ -22,6 +22,7 @@ use App\Models\Product\Product;
use App\Models\Project\DeployOptimize;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Project;
use App\Models\Purchaser\PurchaserInfo;
use App\Services\AmazonS3Service;
use App\Services\ProjectServer;
use App\Utils\EncryptUtils;
... ... @@ -47,11 +48,14 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
$serverIpModel = new ServersIp();
$lists = $serverIpModel->list();
$p = new PurchaserInfo();
$lists = $p->list();
foreach ($lists as $k => $v){
$domain = strtolower($v['domain']);
$serverIpModel->edit(['domain'=>$domain],['id'=>$v['id']]);
$info = $p->read(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer']]);
if($info === false){
continue;
}
$p->del(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer'],'id'=>['!=',$v['id']]]);
}
return true;
}
... ...
... ... @@ -46,12 +46,12 @@ class ReplaceHtmlController extends BaseController
public function replaceTemplateMainHtml(ReplaceHtmlLogic $logic){
$this->request->validate([
'name'=>'required',
'html'=>'required',
// 'html'=>'required',
'old_html'=>'required',
'project_id'=>'required',
],[
'name.required' => '需替换页面标识不能为空',
'html.required' => 'html不能为空',
// 'html.required' => 'html不能为空',
'old_html.required' => '替换前的html不能为空',
'project_id.required' => 'project_id不能为空',
]);
... ...
... ... @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Suppliers;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Purchaser\Purchaser;
use App\Models\Purchaser\PurchaserInfo;
/**
* @remark :推荐采购商
... ... @@ -32,21 +33,14 @@ class SuppliersController extends BaseController
* @time :2024/3/4 10:10
*/
public function recommendedPurchaser(){
$purchaserModel = new Purchaser();
$data = [];
$purchaserModel = new PurchaserInfo();
$this->map['project_id'] = $this->user['project_id'];
$lists = $purchaserModel->list($this->map);
if(!empty($lists)){
foreach ($lists as $v){
if(!empty($v['data'])){
$resultData = json_decode($v['data'],true);
foreach ($resultData as $value){
$value = (array)$value;
$value['keyword'] = $v['keyword'];
$data[] = $value;
}
}
}
$data = $purchaserModel->list($this->map);
foreach ($data as $k => $v){
$v['email'] = json_decode($v['email'],true);
$v['mobile'] = json_decode($v['mobile'],true);
$v['social_media'] = json_decode($v['social_media'],true);
$data[$k] = $v;
}
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -156,7 +156,7 @@ class ReplaceHtmlLogic extends BaseLogic
'template_id'=>$template_id,
'status'=>$this->model::STATUS,
'old_html'=>$param['old_html'],
'html'=>$param['html'],
'html'=>$param['html'] ?? '',
'project_id'=>$param['project_id'],
'total_num'=>0,
'operator_id'=>$this->manager['id']
... ...