作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -167,6 +167,12 @@ class TicketUploadDataController extends BaseController
'type.required' => '上传类型不能为空',
'text' => '数据详情不为空'
]);
if(empty($this->param['text']['image'])){
$this->response('参数错误',Code::SYSTEM_ERROR);
}
if(empty($this->param['text']['title'])){
$this->response('参数错误,标题不能为空',Code::SYSTEM_ERROR);
}
//验证当前数据是否已提交
$this->param['text'] = json_encode($this->param['text'], true);
if(isset($this->param['id']) && !empty($this->param['id'])){
... ... @@ -202,20 +208,26 @@ class TicketUploadDataController extends BaseController
$this->request->validate([
'project_id' => 'required',
'type' => 'required',
'search' => 'required'
], [
'project_id.required' => 'project_id不能为空',
'type.required' => 'type不能为空',
'search.required' => '搜索参数不能为空',
]);
ProjectServer::useProject($this->param['project_id']);
if ($this->param['type'] == 1) {
//todo::搜索获取分类
$productCateModel = new Category();
$data = $productCateModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
if(!isset($this->param['search']) || empty($this->param['search'])){
$data = $productCateModel->lists(['status'=>1], 1, 20,'id',['id','title as name']);
}else{
$data = $productCateModel->lists(['status'=>1,'title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
}
} else {
$keywordModel = new Keyword();
$data = $keywordModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
if(!isset($this->param['search']) || empty($this->param['search'])){
$data = $keywordModel->lists([], 1, 20,'id',['id','title as name']);
}else{
$data = $keywordModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
}
}
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
... ... @@ -239,7 +251,11 @@ class TicketUploadDataController extends BaseController
]);
ProjectServer::useProject($this->param['project_id']);
$blogCateModel = new BlogCategory();
$data = $blogCateModel->lists(['name' => ['like' ,'%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
if(!isset($this->param['search']) || empty($this->param['search'])){
$data = $blogCateModel->lists([], 1, 20,'id',['id','name']);
}else{
$data = $blogCateModel->lists(['name' => ['like' , '%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
}
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
... ... @@ -262,7 +278,11 @@ class TicketUploadDataController extends BaseController
]);
ProjectServer::useProject($this->param['project_id']);
$newsCateModel = new NewsCategory();
$data = $newsCateModel->lists(['name' => ['like' , '%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
if(!isset($this->param['search']) || empty($this->param['search'])){
$data = $newsCateModel->lists([], 1, 20,'id',['id','name']);
}else{
$data = $newsCateModel->lists(['name' => ['like' , '%' . $this->param['search'] . '%']], 1, 20,'id',['id','name']);
}
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
... ...
... ... @@ -66,6 +66,7 @@ class AiVideoLogic extends BaseLogic
$aiVideoTaskModel = new AiVideoTask();
$aiVideoService = new AiVideoService($this->user['project_id']);
$storage = $aiVideoTaskModel->videoSetting()[$this->user['video_setting'] ?? 1];
//todo::获取ayr的key
$result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? [],$storage);
if($result['status'] == 200){
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],'storage'=>$storage]);
... ...
... ... @@ -55,9 +55,12 @@ class AiVideoService
* @method :post
* @time :2025/4/29 17:59
*/
public function createTask($title,$description,$images = [],$anchor = [],$storage = 'CDN'){
public function createTask($title,$description,$images = [],$anchor = [],$storage = 'CDN',$ayrshare_profile_key = ''){
$request_url = $this->url.'api/video/create';
$param = ['title'=>$title, 'description'=>$description, 'images'=>$images,'anchor'=>$anchor,'storage'=>$storage];
if(!empty($ayrshare_profile_key)){
$param['ayrshare_profile_key'] = $ayrshare_profile_key;
}
$param['mch_id'] = $this->mch_id;
$this->sign = $this->generateSign($param,$this->key);
$param['sign'] = $this->sign;
... ...