作者 lyh

gx精准询盘

@@ -81,7 +81,7 @@ class InquiryController extends BaseController @@ -81,7 +81,7 @@ class InquiryController extends BaseController
81 foreach ($data['list'] as $key => $value){ 81 foreach ($data['list'] as $key => $value){
82 $value['phone_data'] = []; 82 $value['phone_data'] = [];
83 foreach ($phoneDataList as $valuePhone){ 83 foreach ($phoneDataList as $valuePhone){
84 - if($value['phone'] == $valuePhone['phone']){ 84 + if($value['phone'] == $valuePhone['num_phone']){
85 $value['phone_data'] = $valuePhone; 85 $value['phone_data'] = $valuePhone;
86 break; 86 break;
87 } 87 }
@@ -7,6 +7,7 @@ use App\Helper\FormGlobalsoApi; @@ -7,6 +7,7 @@ use App\Helper\FormGlobalsoApi;
7 use App\Helper\Translate; 7 use App\Helper\Translate;
8 use App\Http\Logic\Aside\Project\ProjectLogic; 8 use App\Http\Logic\Aside\Project\ProjectLogic;
9 use App\Http\Logic\Bside\BaseLogic; 9 use App\Http\Logic\Bside\BaseLogic;
  10 +use App\Models\Com\WordCountry;
10 use App\Models\Domain\DomainInfo; 11 use App\Models\Domain\DomainInfo;
11 use App\Models\Inquiry\InquiryForm; 12 use App\Models\Inquiry\InquiryForm;
12 use App\Models\Inquiry\InquiryFormData; 13 use App\Models\Inquiry\InquiryFormData;
@@ -212,8 +213,12 @@ class InquiryLogic extends BaseLogic @@ -212,8 +213,12 @@ class InquiryLogic extends BaseLogic
212 'country_code'=>$data['country_code'] ?? '', 213 'country_code'=>$data['country_code'] ?? '',
213 'phone_region'=>$data['phone_region'] ?? '', 214 'phone_region'=>$data['phone_region'] ?? '',
214 ]; 215 ];
215 - if(!empty($param['phone_region'])){  
216 - $param['country'] = Translate::tran($param['phone_region'], 'zh') ?? ''; 216 + if(!empty($param['country_code'])){
  217 + $wordCountryModel = new WordCountry();
  218 + $info = $wordCountryModel->read(['pid'=>0,'iso2'=>$this->param['country_code']],['chinese_name']);
  219 + if($info !== false){
  220 + $param['country'] = $info['chinese_name'];
  221 + }
217 } 222 }
218 (new PhoneData())->addReturnId($param); 223 (new PhoneData())->addReturnId($param);
219 return $this->success($param); 224 return $this->success($param);
@@ -228,13 +233,18 @@ class InquiryLogic extends BaseLogic @@ -228,13 +233,18 @@ class InquiryLogic extends BaseLogic
228 * @author :lyh 233 * @author :lyh
229 * @method :post 234 * @method :post
230 * @time :2025/3/11 14:11 235 * @time :2025/3/11 14:11
  236 + * @param :pid:0->国家
231 */ 237 */
232 public function tranCountry(){ 238 public function tranCountry(){
233 - $country = Translate::tran($this->param['phone_region'], 'zh') ?? '';  
234 - if(!empty($country)){  
235 - $phoneDataModel = new PhoneData();  
236 - $phoneDataModel->edit(['country'=>$country],['phone_region'=>$this->param['phone_region']]); 239 + $wordCountryModel = new WordCountry();
  240 + $info = $wordCountryModel->read(['pid'=>0,'iso2'=>$this->param['country_code']],['chinese_name']);
  241 + if($info !== false){
  242 + $chinese_name = $info['chinese_name'];
  243 + }else{
  244 + $chinese_name = $this->param['country_code'];
237 } 245 }
238 - return $this->success(['country'=>$country]); 246 + $phoneDataModel = new PhoneData();
  247 + $phoneDataModel->edit(['country'=>$info['chinese_name']],['country_code'=>$this->param['country_code']]);
  248 + return $this->success(['country'=>$chinese_name]);
239 } 249 }
240 } 250 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :WordCountry.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/3/11 17:24
  8 + */
  9 +
  10 +namespace App\Models\Com;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :国家信息
  16 + * @name :WordCountry
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/3/11 17:24
  20 + */
  21 +class WordCountry extends Base
  22 +{
  23 + protected $table = 'gl_world_country_city';
  24 +}