作者 lyh

gx

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