作者 lyh

gx

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Helper; 3 namespace App\Helper;
4 4
5 use App\Models\Ai\AiCommand as AiCommandModel; 5 use App\Models\Ai\AiCommand as AiCommandModel;
  6 +use App\Models\Project\Project;
6 use App\Models\User\UserLog as UserLogModel; 7 use App\Models\User\UserLog as UserLogModel;
7 use App\Models\User\UserLogin as UserLoginModel; 8 use App\Models\User\UserLogin as UserLoginModel;
8 use Illuminate\Encryption\Encrypter; 9 use Illuminate\Encryption\Encrypter;
@@ -73,10 +74,10 @@ class Common @@ -73,10 +74,10 @@ class Common
73 if (isset($result['texts']['sl']) && isset(Translate::$tls_list[$result['texts']['sl']])) { 74 if (isset($result['texts']['sl']) && isset(Translate::$tls_list[$result['texts']['sl']])) {
74 $lang = Translate::$tls_list[$result['texts']['sl']]['text']; 75 $lang = Translate::$tls_list[$result['texts']['sl']]['text'];
75 } else { 76 } else {
76 - $lang = '中文'; 77 + $lang = 'Chinese';
77 } 78 }
78 } 79 }
79 - $str = ',请使用'.$lang.'回答'; 80 + $str = 'Please answer in '.$lang;
80 //替换关键字 81 //替换关键字
81 $content = str_replace('$keyword$', $param['keywords'], $info['ai']); 82 $content = str_replace('$keyword$', $param['keywords'], $info['ai']);
82 $data = [ 83 $data = [
@@ -668,4 +668,32 @@ class ProjectController extends BaseController @@ -668,4 +668,32 @@ class ProjectController extends BaseController
668 $lists = $renewLog->lists($this->map,$this->page,$this->row,$this->order); 668 $lists = $renewLog->lists($this->map,$this->page,$this->row,$this->order);
669 $this->response('success',Code::SUCCESS,$lists); 669 $this->response('success',Code::SUCCESS,$lists);
670 } 670 }
  671 +
  672 + /**
  673 + * @remark :A端同步项目信息
  674 + * @name :syncProjectDetails
  675 + * @author :lyh
  676 + * @method :post
  677 + * @time :2023/10/26 14:32
  678 + */
  679 + public function syncProjectDetails($project_id){
  680 + $projectModel = new Project();
  681 + $info = $projectModel->with('payment')->with('deploy_build')
  682 + ->with('deploy_optimize')->where(['id'=>$project_id])->first()->toArray();
  683 + $url = 'https://form.globalso.com/api/globalsov6';
  684 + $data = [
  685 + 'id' => $info['from_order_id'],
  686 + 'company_name'=>$info['company'],
  687 + 'emails'=> '',
  688 + 'phones'=>$info['mobile'],
  689 + 'plan'=>Project::planMap()[$info['plan']],
  690 + 'main_url'=>$info['domain'],
  691 + 'test_url'=>$info['test_domain'],
  692 + 'token'=>md5($info['from_order_id'].'qqs'.date('Y-m-d')),
  693 + ];
  694 + $header = array(
  695 + "charset=utf-8"
  696 + );
  697 + return http_post($url,$data,$header);
  698 + }
671 } 699 }