作者 lyh

gx精准询盘

... ... @@ -81,7 +81,7 @@ class InquiryController extends BaseController
foreach ($data['list'] as $key => $value){
$value['phone_data'] = [];
foreach ($phoneDataList as $valuePhone){
if($value['phone'] == $valuePhone['phone']){
if($value['phone'] == $valuePhone['num_phone']){
$value['phone_data'] = $valuePhone;
break;
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Helper\FormGlobalsoApi;
use App\Helper\Translate;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Com\WordCountry;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryForm;
use App\Models\Inquiry\InquiryFormData;
... ... @@ -212,8 +213,12 @@ class InquiryLogic extends BaseLogic
'country_code'=>$data['country_code'] ?? '',
'phone_region'=>$data['phone_region'] ?? '',
];
if(!empty($param['phone_region'])){
$param['country'] = Translate::tran($param['phone_region'], 'zh') ?? '';
if(!empty($param['country_code'])){
$wordCountryModel = new WordCountry();
$info = $wordCountryModel->read(['pid'=>0,'iso2'=>$this->param['country_code']],['chinese_name']);
if($info !== false){
$param['country'] = $info['chinese_name'];
}
}
(new PhoneData())->addReturnId($param);
return $this->success($param);
... ... @@ -228,13 +233,18 @@ class InquiryLogic extends BaseLogic
* @author :lyh
* @method :post
* @time :2025/3/11 14:11
* @param :pid:0->国家
*/
public function tranCountry(){
$country = Translate::tran($this->param['phone_region'], 'zh') ?? '';
if(!empty($country)){
$phoneDataModel = new PhoneData();
$phoneDataModel->edit(['country'=>$country],['phone_region'=>$this->param['phone_region']]);
$wordCountryModel = new WordCountry();
$info = $wordCountryModel->read(['pid'=>0,'iso2'=>$this->param['country_code']],['chinese_name']);
if($info !== false){
$chinese_name = $info['chinese_name'];
}else{
$chinese_name = $this->param['country_code'];
}
return $this->success(['country'=>$country]);
$phoneDataModel = new PhoneData();
$phoneDataModel->edit(['country'=>$info['chinese_name']],['country_code'=>$this->param['country_code']]);
return $this->success(['country'=>$chinese_name]);
}
}
... ...
<?php
/**
* @remark :
* @name :WordCountry.php
* @author :lyh
* @method :post
* @time :2025/3/11 17:24
*/
namespace App\Models\Com;
use App\Models\Base;
/**
* @remark :国家信息
* @name :WordCountry
* @author :lyh
* @method :post
* @time :2025/3/11 17:24
*/
class WordCountry extends Base
{
protected $table = 'gl_world_country_city';
}
... ...