合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2480
正在显示
7 个修改的文件
包含
27 行增加
和
26 行删除
| @@ -12,7 +12,6 @@ namespace App\Console\Commands\Ai; | @@ -12,7 +12,6 @@ namespace App\Console\Commands\Ai; | ||
| 12 | use App\Models\Product\Product; | 12 | use App\Models\Product\Product; |
| 13 | use App\Models\Project\DeployOptimize; | 13 | use App\Models\Project\DeployOptimize; |
| 14 | use App\Models\Project\Project; | 14 | use App\Models\Project\Project; |
| 15 | -use App\Models\WebSetting\WebSetting; | ||
| 16 | use App\Services\ProjectServer; | 15 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Console\Command; | 16 | use Illuminate\Console\Command; |
| 18 | use Illuminate\Support\Facades\DB; | 17 | use Illuminate\Support\Facades\DB; |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Console\Commands\LyhTest; | 10 | namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | +use App\Helper\OaGlobalsoApi; | ||
| 12 | use App\Models\Ai\AiBlog; | 13 | use App\Models\Ai\AiBlog; |
| 13 | use App\Models\News\News; | 14 | use App\Models\News\News; |
| 14 | use App\Models\Product\Category; | 15 | use App\Models\Product\Category; |
| @@ -44,25 +45,9 @@ class lyhDemo extends Command | @@ -44,25 +45,9 @@ class lyhDemo extends Command | ||
| 44 | protected $description = '更新路由'; | 45 | protected $description = '更新路由'; |
| 45 | 46 | ||
| 46 | public function handle(){ | 47 | public function handle(){ |
| 47 | - $projectModel = new Project(); | ||
| 48 | - $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'id'=>3659,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | ||
| 49 | - foreach ($lists as $val){ | ||
| 50 | - echo date('Y-m-d H:i:s') . '开始--项目的id:'. $val['id'] . PHP_EOL; | ||
| 51 | - ProjectServer::useProject($val['id']); | ||
| 52 | - $settingModel = new WebSetting(); | ||
| 53 | - $info = $settingModel->read(['project_id'=>$val['id']]); | ||
| 54 | - if($info === false){ | ||
| 55 | - echo '跳过当前数据'.PHP_EOL; | ||
| 56 | - continue; | ||
| 57 | - } | ||
| 58 | - if(empty($info['anchor_setting'])){ | ||
| 59 | - $settingModel->edit(['anchor_setting'=>["5","3","4"]],['project_id'=>$val['id']]); | ||
| 60 | - }else{ | ||
| 61 | - echo '已有数据'.PHP_EOL; | ||
| 62 | - } | ||
| 63 | - DB::disconnect('custom_mysql'); | ||
| 64 | - echo date('Y-m-d H:i:s') . '结束--项目的id:'. $val['id'] . PHP_EOL; | ||
| 65 | - } | 48 | + $api = new OaGlobalsoApi(); |
| 49 | + $data = $api->order_info('12551'); | ||
| 50 | + dd($data); | ||
| 66 | } | 51 | } |
| 67 | 52 | ||
| 68 | /** | 53 | /** |
| @@ -202,7 +202,8 @@ class SyncProject extends Command | @@ -202,7 +202,8 @@ class SyncProject extends Command | ||
| 202 | * @param :version:7->v7版本(升级项目默认为v7) | 202 | * @param :version:7->v7版本(升级项目默认为v7) |
| 203 | */ | 203 | */ |
| 204 | public function sync($param,$is_update = 0){ | 204 | public function sync($param,$is_update = 0){ |
| 205 | - $version = (($is_update == 1) ? Project::VERSION_SEVEN : ($param['version'] ?? Project::VERSION_ZERO)); | 205 | + //TODO::4月12日 之前的项目都是v6 |
| 206 | + $version = (($is_update == 1) ? Project::VERSION_SIX : (empty($param['version']) ? Project::VERSION_SEVEN : $param['version'])); | ||
| 206 | $title = date('Ymd') . '-' . $param['company_name']; | 207 | $title = date('Ymd') . '-' . $param['company_name']; |
| 207 | $data = [ | 208 | $data = [ |
| 208 | 'project'=>[ | 209 | 'project'=>[ |
| @@ -63,11 +63,12 @@ class AiVideoLogic extends BaseLogic | @@ -63,11 +63,12 @@ class AiVideoLogic extends BaseLogic | ||
| 63 | * @detail :status=1/待执行 | 63 | * @detail :status=1/待执行 |
| 64 | */ | 64 | */ |
| 65 | public function sendTask(){ | 65 | public function sendTask(){ |
| 66 | + $aiVideoTaskModel = new AiVideoTask(); | ||
| 66 | $aiVideoService = new AiVideoService($this->user['project_id']); | 67 | $aiVideoService = new AiVideoService($this->user['project_id']); |
| 67 | - $result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? []); | 68 | + $storage = $aiVideoTaskModel->videoSetting()[$this->user['video_setting'] ?? 1]; |
| 69 | + $result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? [],$storage); | ||
| 68 | if($result['status'] == 200){ | 70 | if($result['status'] == 200){ |
| 69 | - $aiVideoTaskModel = new AiVideoTask(); | ||
| 70 | - $aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id']]); | 71 | + $aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],'storage'=>$storage]); |
| 71 | $id = $this->model->addReturnId(['title'=>$this->param['title'],'task_id'=>$result['data']['task_id'],'description'=>$this->param['description'],'project_id'=>$this->user['project_id'],'images'=>json_encode($this->param['images'],true),'anchor'=>json_encode($this->param['anchor'] ?? [],true)]); | 72 | $id = $this->model->addReturnId(['title'=>$this->param['title'],'task_id'=>$result['data']['task_id'],'description'=>$this->param['description'],'project_id'=>$this->user['project_id'],'images'=>json_encode($this->param['images'],true),'anchor'=>json_encode($this->param['anchor'] ?? [],true)]); |
| 72 | return $this->success(['id'=>$id]); | 73 | return $this->success(['id'=>$id]); |
| 73 | } | 74 | } |
| @@ -277,6 +277,7 @@ class UserLoginLogic | @@ -277,6 +277,7 @@ class UserLoginLogic | ||
| 277 | $info['main_lang_id'] = $project['main_lang_id']; | 277 | $info['main_lang_id'] = $project['main_lang_id']; |
| 278 | $info['is_ai_blog'] = $project['is_ai_blog'] ?? 0; | 278 | $info['is_ai_blog'] = $project['is_ai_blog'] ?? 0; |
| 279 | $info['is_ai_video'] = $project['is_ai_video'] ?? 0; | 279 | $info['is_ai_video'] = $project['is_ai_video'] ?? 0; |
| 280 | + $info['video_setting'] = $project['deploy_optimize']['video_setting'] ?? 1; | ||
| 280 | $info['image_max'] = $project['image_max']; | 281 | $info['image_max'] = $project['image_max']; |
| 281 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; | 282 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; |
| 282 | $info['uptime_type'] = $this->getHistory($project); | 283 | $info['uptime_type'] = $this->getHistory($project); |
| @@ -20,4 +20,18 @@ class AiVideoTask extends Base | @@ -20,4 +20,18 @@ class AiVideoTask extends Base | ||
| 20 | */ | 20 | */ |
| 21 | const STATUS_RUNNING = 1; | 21 | const STATUS_RUNNING = 1; |
| 22 | const STATUS_FINISH = 2; | 22 | const STATUS_FINISH = 2; |
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :视频设置 | ||
| 26 | + * @name :videoSetting | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2025/8/1 17:17 | ||
| 30 | + */ | ||
| 31 | + public function videoSetting(){ | ||
| 32 | + return [ | ||
| 33 | + 1 => 'CDN', | ||
| 34 | + 2 => 'YOUTUBE' | ||
| 35 | + ]; | ||
| 36 | + } | ||
| 23 | } | 37 | } |
| @@ -55,9 +55,9 @@ class AiVideoService | @@ -55,9 +55,9 @@ class AiVideoService | ||
| 55 | * @method :post | 55 | * @method :post |
| 56 | * @time :2025/4/29 17:59 | 56 | * @time :2025/4/29 17:59 |
| 57 | */ | 57 | */ |
| 58 | - public function createTask($title,$description,$images = [],$anchor = []){ | 58 | + public function createTask($title,$description,$images = [],$anchor = [],$storage = 'CDN'){ |
| 59 | $request_url = $this->url.'api/video/create'; | 59 | $request_url = $this->url.'api/video/create'; |
| 60 | - $param = ['title'=>$title, 'description'=>$description, 'images'=>$images,'anchor'=>$anchor]; | 60 | + $param = ['title'=>$title, 'description'=>$description, 'images'=>$images,'anchor'=>$anchor,'storage'=>$storage]; |
| 61 | $param['mch_id'] = $this->mch_id; | 61 | $param['mch_id'] = $this->mch_id; |
| 62 | $this->sign = $this->generateSign($param,$this->key); | 62 | $this->sign = $this->generateSign($param,$this->key); |
| 63 | $param['sign'] = $this->sign; | 63 | $param['sign'] = $this->sign; |
-
请 注册 或 登录 后发表评论