作者 赵彬吉
@@ -117,13 +117,16 @@ class VideoTask extends Command @@ -117,13 +117,16 @@ class VideoTask extends Command
117 } 117 }
118 $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']); 118 $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']);
119 if(!empty($keywordInfo['product_list'])){ 119 if(!empty($keywordInfo['product_list'])){
  120 + if(!empty($task_project->logo_img)){
  121 + $logo_bg['logo'] = $task_project->logo_img;
  122 + }
120 $array = [ 123 $array = [
121 'project_id' => $task_project->project_id, 124 'project_id' => $task_project->project_id,
122 'keyword_id' => $val->id, 125 'keyword_id' => $val->id,
123 'keyword' => $val->title, 126 'keyword' => $val->title,
124 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], 127 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'],
125 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], 128 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'],
126 - 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]), 129 + 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg , 'template_data' => $task_project->template_data]),
127 'status' => KeywordVideoTaskLog::STATUS_INIT, 130 'status' => KeywordVideoTaskLog::STATUS_INIT,
128 'updated_at' => date('Y-m-d H:i:s'), 131 'updated_at' => date('Y-m-d H:i:s'),
129 'created_at' => date('Y-m-d H:i:s'), 132 'created_at' => date('Y-m-d H:i:s'),
@@ -162,7 +165,8 @@ class VideoTask extends Command @@ -162,7 +165,8 @@ class VideoTask extends Command
162 'description' => $valData['description'], 165 'description' => $valData['description'],
163 'images' => $valData['images'], 166 'images' => $valData['images'],
164 'logo'=> $valData['logo_bg']['logo'] ?? '', 167 'logo'=> $valData['logo_bg']['logo'] ?? '',
165 - 'bg'=> $valData['logo_bg']['bg'] ?? '' 168 + 'bg'=> $valData['logo_bg']['bg'] ?? '',
  169 + 'template_id'=> ((array)$valData['template_data'])['template_id'] ?? '',
166 ], 170 ],
167 'task_id' => $task_id, 171 'task_id' => $task_id,
168 'callback_url' => env('APP_URL') . '/api/video_task_callback', 172 'callback_url' => env('APP_URL') . '/api/video_task_callback',
@@ -7,13 +7,14 @@ @@ -7,13 +7,14 @@
7 * @time :2024/2/26 9:23 7 * @time :2024/2/26 9:23
8 */ 8 */
9 9
10 -namespace App\Http\Controllers\Aside\Com; 10 +namespace App\Http\Controllers\Aside\KeywordVideo;
11 11
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Controllers\Aside\BaseController; 13 use App\Http\Controllers\Aside\BaseController;
14 use App\Models\Com\KeywordVideoTask; 14 use App\Models\Com\KeywordVideoTask;
15 use App\Models\Com\KeywordVideoTaskLog; 15 use App\Models\Com\KeywordVideoTaskLog;
16 use App\Models\Domain\DomainInfo; 16 use App\Models\Domain\DomainInfo;
  17 +use Illuminate\Support\Facades\Cache;
17 18
18 class KeywordVideoController extends BaseController 19 class KeywordVideoController extends BaseController
19 { 20 {
@@ -114,6 +115,8 @@ class KeywordVideoController extends BaseController @@ -114,6 +115,8 @@ class KeywordVideoController extends BaseController
114 'status'=>$this->param['status'] ?? 0, 115 'status'=>$this->param['status'] ?? 0,
115 'sort'=>$this->param['sort'] ?? 0, 116 'sort'=>$this->param['sort'] ?? 0,
116 'keywords'=>$this->param['keywords'] ?? '', 117 'keywords'=>$this->param['keywords'] ?? '',
  118 + 'logo_img'=>$this->param['logo_img'] ?? '',
  119 + 'template_data'=>isset($this->param['template_data']) ? json_encode($this->param['template_data'],true) : null
117 ]; 120 ];
118 $rs = $keywordModel->add($data); 121 $rs = $keywordModel->add($data);
119 if($rs === false){ 122 if($rs === false){
@@ -136,6 +139,9 @@ class KeywordVideoController extends BaseController @@ -136,6 +139,9 @@ class KeywordVideoController extends BaseController
136 'id.required' => '主键标识不为空', 139 'id.required' => '主键标识不为空',
137 ]); 140 ]);
138 $keywordModel = new KeywordVideoTask(); 141 $keywordModel = new KeywordVideoTask();
  142 + if(isset($this->param['template_data']) && !empty($this->param['template_data'])){
  143 + $this->param['template_data'] = json_encode($this->param['template_data'],true);
  144 + }
139 $rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]); 145 $rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]);
140 if($rs === false){ 146 if($rs === false){
141 $this->response('编辑失败',Code::SYSTEM_ERROR); 147 $this->response('编辑失败',Code::SYSTEM_ERROR);
@@ -193,4 +199,27 @@ class KeywordVideoController extends BaseController @@ -193,4 +199,27 @@ class KeywordVideoController extends BaseController
193 $count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count(); 199 $count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count();
194 $this->response('success',Code::SUCCESS,['count'=>$count]); 200 $this->response('success',Code::SUCCESS,['count'=>$count]);
195 } 201 }
  202 +
  203 + /**
  204 + * @remark :获取模版库模版
  205 + * @name :get_template
  206 + * @author :lyh
  207 + * @method :post
  208 + * @time :2024/11/1 11:48
  209 + */
  210 + public function get_template(){
  211 + $data = Cache::get('template_data');
  212 + if(empty($data)){
  213 + $url = 'http://216.250.255.116:7866/get_template';
  214 + $header = [
  215 + 'accept: application/json'
  216 + ];
  217 + $data = http_get($url,$header);
  218 + if(!empty($data['data']) && $data['code'] == 200){
  219 + $data = $data['data'];
  220 + Cache::put('template_data',$data,12 * 3600);
  221 + }
  222 + }
  223 + $this->response('success',Code::SUCCESS,$data);
  224 + }
196 } 225 }
@@ -26,6 +26,7 @@ use App\Models\Manage\Manage; @@ -26,6 +26,7 @@ use App\Models\Manage\Manage;
26 use App\Models\Manage\ManageHr; 26 use App\Models\Manage\ManageHr;
27 use App\Models\Project\DeployBuild; 27 use App\Models\Project\DeployBuild;
28 use App\Models\Project\Payment; 28 use App\Models\Project\Payment;
  29 +use App\Models\Project\ProcessRecords;
29 use App\Models\Project\Project; 30 use App\Models\Project\Project;
30 use App\Models\Project\ProjectUpdateTdk; 31 use App\Models\Project\ProjectUpdateTdk;
31 use App\Models\Project\RenewLog; 32 use App\Models\Project\RenewLog;
@@ -356,6 +357,14 @@ class ProjectController extends BaseController @@ -356,6 +357,14 @@ class ProjectController extends BaseController
356 if($item['type'] != Project::TYPE_ZERO){ 357 if($item['type'] != Project::TYPE_ZERO){
357 $data = APublicModel::getNumByProjectId($item['id']); 358 $data = APublicModel::getNumByProjectId($item['id']);
358 } 359 }
  360 + if($item['type'] == Project::TYPE_ONE){//建站中
  361 + $processModel = new ProcessRecords();
  362 + $item['sign_project'] = 0;
  363 + $proInfo = $processModel->read(['project_id'=>$item['id'],'updated_at'=>['>=',time() - 3 * 12 * 3600]],['id']);
  364 + if($proInfo === false){
  365 + $item['sign_project'] = 1;
  366 + }
  367 + }
359 $manageModel = new ManageHr(); 368 $manageModel = new ManageHr();
360 $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0); 369 $item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0);
361 $item['build_leader'] = $manageModel->getName($item['leader_mid']); 370 $item['build_leader'] = $manageModel->getName($item['leader_mid']);
@@ -32,6 +32,9 @@ class CustomModuleCategoryController extends BaseController @@ -32,6 +32,9 @@ class CustomModuleCategoryController extends BaseController
32 ],[ 32 ],[
33 'module_id.required' => 'module_id不能为空', 33 'module_id.required' => 'module_id不能为空',
34 ]); 34 ]);
  35 + //获取模块路由
  36 + $customModuleModel = new CustomModule();
  37 + $moduleInfo = $customModuleModel->read(['id'=>$this->param['module_id']]);
35 $this->map['project_id'] = $this->user['project_id']; 38 $this->map['project_id'] = $this->user['project_id'];
36 $this->map['status'] = 0; 39 $this->map['status'] = 0;
37 $list = $customModuleCategory->list($this->map,'sort'); 40 $list = $customModuleCategory->list($this->map,'sort');
@@ -40,6 +43,11 @@ class CustomModuleCategoryController extends BaseController @@ -40,6 +43,11 @@ class CustomModuleCategoryController extends BaseController
40 foreach ($list as $k => $v){ 43 foreach ($list as $k => $v){
41 $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); 44 $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM);
42 $v['url'] = $this->user['domain'].$v['route']; 45 $v['url'] = $this->user['domain'].$v['route'];
  46 + if($this->user['is_upgrade'] == 1){
  47 + if($v['route'] != $moduleInfo['route']){
  48 + $v['url'] = $this->user['domain'].$moduleInfo['route']."_catalog/".$v['route'];
  49 + }
  50 + }
43 $list[$k] = $v; 51 $list[$k] = $v;
44 } 52 }
45 } 53 }
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Http\Logic\Bside\News; 3 namespace App\Http\Logic\Bside\News;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
  6 +use App\Helper\Arr;
6 use App\Http\Logic\Bside\BaseLogic; 7 use App\Http\Logic\Bside\BaseLogic;
7 use App\Models\News\News; 8 use App\Models\News\News;
8 use App\Models\News\NewsCategory; 9 use App\Models\News\NewsCategory;
@@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic @@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic
185 if(isset($param['image'])){ 186 if(isset($param['image'])){
186 $param['image'] = str_replace_url($param['image'] ?? ''); 187 $param['image'] = str_replace_url($param['image'] ?? '');
187 } 188 }
188 - if(isset($param['related_news_id'])){  
189 - $param['related_news_id'] = implode(',',$param['related_news_id']);  
190 - } 189 +
191 if(isset($this->param['id'])){ 190 if(isset($this->param['id'])){
192 $param['operator_id'] = $this->user['id']; 191 $param['operator_id'] = $this->user['id'];
193 }else{ 192 }else{
@@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic @@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic
204 $this->fail('发布时间需大于当天'); 203 $this->fail('发布时间需大于当天');
205 } 204 }
206 } 205 }
  206 + if(isset($param['related_news_id'])){
  207 + $param['related_news_id'] = implode(',',$param['related_news_id']);
  208 + }
207 return $this->success($param); 209 return $this->success($param);
208 } 210 }
209 211
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Models\Com; 10 namespace App\Models\Com;
11 11
  12 +use App\Helper\Arr;
12 use App\Models\Base; 13 use App\Models\Base;
13 14
14 class KeywordVideoTask extends Base 15 class KeywordVideoTask extends Base
@@ -17,4 +18,10 @@ class KeywordVideoTask extends Base @@ -17,4 +18,10 @@ class KeywordVideoTask extends Base
17 const STATUS_CLOSE = 1;//停止 18 const STATUS_CLOSE = 1;//停止
18 19
19 protected $table = 'gl_keyword_video_task'; 20 protected $table = 'gl_keyword_video_task';
  21 +
  22 + public function getTemplateDataAttribute($value)
  23 + {
  24 + $value = Arr::s2a($value);
  25 + return $value;
  26 + }
20 } 27 }
@@ -348,12 +348,13 @@ Route::middleware(['aloginauth'])->group(function () { @@ -348,12 +348,13 @@ Route::middleware(['aloginauth'])->group(function () {
348 * 生成视频的项目 348 * 生成视频的项目
349 */ 349 */
350 Route::prefix('keyword_video')->group(function () { 350 Route::prefix('keyword_video')->group(function () {
351 - Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('keyword_video_lists');  
352 - Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask');  
353 - Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit');  
354 - Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog');  
355 - Route::any('/taskNum', [Aside\Com\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum');  
356 - Route::any('/getVideoCount', [Aside\Com\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount'); 351 + Route::any('/', [Aside\KeywordVideo\KeywordVideoController::class, 'lists'])->name('keyword_video_lists');
  352 + Route::any('/createKeywordTask', [Aside\KeywordVideo\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask');
  353 + Route::any('/edit', [Aside\KeywordVideo\KeywordVideoController::class, 'edit'])->name('keyword_video_edit');
  354 + Route::any('/getVideoTaskLog', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog');
  355 + Route::any('/taskNum', [Aside\KeywordVideo\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum');
  356 + Route::any('/getVideoCount', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount');
  357 + Route::any('/get_template', [Aside\KeywordVideo\KeywordVideoController::class, 'get_template'])->name('keyword_get_template');
357 }); 358 });
358 359
359 // 公共主题模版 360 // 公共主题模版