作者 lyh

gx

@@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside; @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside;
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Helper\FormGlobalsoApi; 13 use App\Helper\FormGlobalsoApi;
14 use App\Helper\PayStripeApi; 14 use App\Helper\PayStripeApi;
  15 +use App\Helper\Translate;
15 use App\Http\Logic\Bside\News\NewsLogic; 16 use App\Http\Logic\Bside\News\NewsLogic;
16 use App\Models\Ai\AiBlog; 17 use App\Models\Ai\AiBlog;
17 use App\Models\Channel\Channel; 18 use App\Models\Channel\Channel;
@@ -42,11 +43,7 @@ class TestController extends BaseController @@ -42,11 +43,7 @@ class TestController extends BaseController
42 */ 43 */
43 public function ceshi(){ 44 public function ceshi(){
44 //获取上一周询盘数量 45 //获取上一周询盘数量
45 - $service = new GoogleKeywordInsightService();  
46 - $list = $service->requestUrl('cnc');  
47 - if(!empty($list)){  
48 -  
49 - }  
50 - $this->response('success',Code::SUCCESS,$list); 46 + $transData = Translate::tran(['heidenhain programming','heidenhain tnc 620'], 'zh');
  47 + $this->response('success',Code::SUCCESS,$transData);
51 } 48 }
52 } 49 }
@@ -25,6 +25,7 @@ class GoogleKeywordInsightDetail extends Base @@ -25,6 +25,7 @@ class GoogleKeywordInsightDetail extends Base
25 */ 25 */
26 public function saveInsightDetail($project_id,$keyword,$data){ 26 public function saveInsightDetail($project_id,$keyword,$data){
27 $saveData = []; 27 $saveData = [];
  28 + $transData = $this->translateZh($data);
28 foreach ($data as $val){ 29 foreach ($data as $val){
29 $saveData[] = [ 30 $saveData[] = [
30 'search'=>$keyword, 31 'search'=>$keyword,
@@ -40,4 +41,15 @@ class GoogleKeywordInsightDetail extends Base @@ -40,4 +41,15 @@ class GoogleKeywordInsightDetail extends Base
40 } 41 }
41 return $this->insertAll($saveData); 42 return $this->insertAll($saveData);
42 } 43 }
  44 +
  45 + /**
  46 + * @remark :翻译中文
  47 + * @name :translateZh
  48 + * @author :lyh
  49 + * @method :post
  50 + * @time :2025/3/25 17:21
  51 + */
  52 + public function translateZh($data){
  53 + return Translate::tran($data, 'zh');
  54 + }
43 } 55 }