作者 lyh

gx

... ... @@ -83,7 +83,7 @@ class Common
$data = [
'messages'=>[
['role'=>'system','content'=>$info['scene']],
['role'=>'assistant','content'=>$content.$str],
['role'=>'user','content'=>$content.$str],
]
];
return http_post($url,json_encode($data));
... ...
... ... @@ -5,7 +5,9 @@ namespace App\Http\Controllers\Aside;
use App\Enums\Common\Code;
use App\Http\Logic\Aside\LoginLogic;
use App\Models\Domain\DomainInfo;
use App\Models\Manage\Manage;
use App\Models\Project\Project;
use App\Models\Sms\SmsLog;
use App\Rules\Mobile;
use Illuminate\Http\Request;
... ... @@ -99,4 +101,29 @@ class LoginController extends BaseController
$this->response('success');
}
public function ceshi(){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->where(['id'=>1])->first()->toArray();
$url = 'https://form.globalso.com/api/globalsov6';
$data = [
'id' => $info['from_order_id'],
'company_name'=>$info['company'],
'token'=>md5($info['from_order_id'].'qqs'.date('Y-m-d')),
];
if(!empty($info['mobile'])){
$data['mobile'] = $info['mobile'];
}
if(!empty($info['deploy_optimize']['domain'])){
$domainModel = new DomainInfo();
$data['main_url'] = $domainModel->getDomain($info['deploy_optimize']['domain']);
}
if($info['deploy_build']['test_domain']){
$data['test_url'] = $info['deploy_build']['test_domain'];
}
$header = array(
"charset=utf-8"
);
return http_post($url,$data,$header);
}
}
... ...
... ... @@ -669,31 +669,5 @@ class ProjectController extends BaseController
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :A端同步项目信息
* @name :syncProjectDetails
* @author :lyh
* @method :post
* @time :2023/10/26 14:32
*/
public function syncProjectDetails($project_id){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->where(['id'=>$project_id])->first()->toArray();
$url = 'https://form.globalso.com/api/globalsov6';
$data = [
'id' => $info['from_order_id'],
'company_name'=>$info['company'],
'emails'=> '',
'phones'=>$info['mobile'],
'plan'=>Project::planMap()[$info['plan']],
'main_url'=>$info['domain'],
'test_url'=>$info['test_domain'],
'token'=>md5($info['from_order_id'].'qqs'.date('Y-m-d')),
];
$header = array(
"charset=utf-8"
);
return http_post($url,$data,$header);
}
}
... ...
... ... @@ -12,7 +12,7 @@ use App\Models\Ai\AiLog;
class AiCommandController extends BaseController
{
//获取文本内容
public $chat_url = 'v2/openai_chat';
public $chat_url = 'v2/openai_chat_qqs';
/**
* @name :ai生成
* @author :liyuhang
... ...
... ... @@ -114,6 +114,10 @@ class ProjectLogic extends BaseLogic
//创建站点
$this->createSite($this->param);
}
//同步项目数据到询盘系统(完成建站后同步数据)
if(in_array($this->map['type'], [Project::TYPE_TWO, Project::TYPE_THREE])){
$this->syncProjectDetails($this->param['id']);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ... @@ -264,18 +268,6 @@ class ProjectLogic extends BaseLogic
if($param['type'] == Project::TYPE_ONE){
//改为异步
NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]);
// //初始化数据库
// if(isset($param['mysql_id']) && !empty($param['mysql_id'])){
// $this->initializationMysql($param['id']);
// }
// //初始账号
// if(isset($param['mobile']) && !empty($param['mobile'])){
// $this->createUser($param['mobile'],$param['id'],$param['lead_name']);
// }
// //更改服务器状态
// if(isset($param['serve_id']) && !empty($param['serve_id'])){
// $this->updateServe($param['serve_id']);
// }
}
return $this->success();
}
... ... @@ -523,4 +515,38 @@ class ProjectLogic extends BaseLogic
}
}
}
/**
* @remark :A端同步项目信息
* @name :syncProjectDetails
* @author :lyh
* @method :post
* @time :2023/10/26 14:32
*/
public function syncProjectDetails($project_id){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->where(['id'=>$project_id])->first()->toArray();
$url = 'https://form.globalso.com/api/globalsov6';
$data = [
'id' => $info['from_order_id'],
'company_name'=>$info['company'],
'token'=>md5($info['from_order_id'].'qqs'.date('Y-m-d')),
];
if(!empty($info['mobile'])){
$data['mobile'] = $info['mobile'];
}
if(!empty($info['deploy_optimize']['domain'])){
$domainModel = new DomainInfo();
$data['main_url'] = $domainModel->getDomain($info['deploy_optimize']['domain']);
}
if($info['deploy_build']['test_domain']){
$data['test_url'] = $info['deploy_build']['test_domain'];
}
$header = array(
"charset=utf-8"
);
return http_post($url,$data,$header);
}
}
... ...