作者 赵彬吉
... ... @@ -117,13 +117,16 @@ class VideoTask extends Command
}
$keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']);
if(!empty($keywordInfo['product_list'])){
if(!empty($task_project->logo_img)){
$logo_bg['logo'] = $task_project->logo_img;
}
$array = [
'project_id' => $task_project->project_id,
'keyword_id' => $val->id,
'keyword' => $val->title,
'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'],
'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'],
'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]),
'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg , 'template_data' => $task_project->template_data]),
'status' => KeywordVideoTaskLog::STATUS_INIT,
'updated_at' => date('Y-m-d H:i:s'),
'created_at' => date('Y-m-d H:i:s'),
... ... @@ -162,7 +165,8 @@ class VideoTask extends Command
'description' => $valData['description'],
'images' => $valData['images'],
'logo'=> $valData['logo_bg']['logo'] ?? '',
'bg'=> $valData['logo_bg']['bg'] ?? ''
'bg'=> $valData['logo_bg']['bg'] ?? '',
'template_id'=> ((array)$valData['template_data'])['template_id'] ?? '',
],
'task_id' => $task_id,
'callback_url' => env('APP_URL') . '/api/video_task_callback',
... ...
... ... @@ -7,13 +7,14 @@
* @time :2024/2/26 9:23
*/
namespace App\Http\Controllers\Aside\Com;
namespace App\Http\Controllers\Aside\KeywordVideo;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\Com\KeywordVideoTask;
use App\Models\Com\KeywordVideoTaskLog;
use App\Models\Domain\DomainInfo;
use Illuminate\Support\Facades\Cache;
class KeywordVideoController extends BaseController
{
... ... @@ -114,6 +115,8 @@ class KeywordVideoController extends BaseController
'status'=>$this->param['status'] ?? 0,
'sort'=>$this->param['sort'] ?? 0,
'keywords'=>$this->param['keywords'] ?? '',
'logo_img'=>$this->param['logo_img'] ?? '',
'template_data'=>isset($this->param['template_data']) ? json_encode($this->param['template_data'],true) : null
];
$rs = $keywordModel->add($data);
if($rs === false){
... ... @@ -136,6 +139,9 @@ class KeywordVideoController extends BaseController
'id.required' => '主键标识不为空',
]);
$keywordModel = new KeywordVideoTask();
if(isset($this->param['template_data']) && !empty($this->param['template_data'])){
$this->param['template_data'] = json_encode($this->param['template_data'],true);
}
$rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->response('编辑失败',Code::SYSTEM_ERROR);
... ... @@ -193,4 +199,27 @@ class KeywordVideoController extends BaseController
$count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count();
$this->response('success',Code::SUCCESS,['count'=>$count]);
}
/**
* @remark :获取模版库模版
* @name :get_template
* @author :lyh
* @method :post
* @time :2024/11/1 11:48
*/
public function get_template(){
$data = Cache::get('template_data');
if(empty($data)){
$url = 'http://216.250.255.116:7866/get_template';
$header = [
'accept: application/json'
];
$data = http_get($url,$header);
if(!empty($data['data']) && $data['code'] == 200){
$data = $data['data'];
Cache::put('template_data',$data,12 * 3600);
}
}
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -26,6 +26,7 @@ use App\Models\Manage\Manage;
use App\Models\Manage\ManageHr;
use App\Models\Project\DeployBuild;
use App\Models\Project\Payment;
use App\Models\Project\ProcessRecords;
use App\Models\Project\Project;
use App\Models\Project\ProjectUpdateTdk;
use App\Models\Project\RenewLog;
... ... @@ -356,6 +357,14 @@ class ProjectController extends BaseController
if($item['type'] != Project::TYPE_ZERO){
$data = APublicModel::getNumByProjectId($item['id']);
}
if($item['type'] == Project::TYPE_ONE){//建站中
$processModel = new ProcessRecords();
$item['sign_project'] = 0;
$proInfo = $processModel->read(['project_id'=>$item['id'],'updated_at'=>['>=',time() - 3 * 12 * 3600]],['id']);
if($proInfo === false){
$item['sign_project'] = 1;
}
}
$manageModel = new ManageHr();
$item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0);
$item['build_leader'] = $manageModel->getName($item['leader_mid']);
... ...
... ... @@ -32,6 +32,9 @@ class CustomModuleCategoryController extends BaseController
],[
'module_id.required' => 'module_id不能为空',
]);
//获取模块路由
$customModuleModel = new CustomModule();
$moduleInfo = $customModuleModel->read(['id'=>$this->param['module_id']]);
$this->map['project_id'] = $this->user['project_id'];
$this->map['status'] = 0;
$list = $customModuleCategory->list($this->map,'sort');
... ... @@ -40,6 +43,11 @@ class CustomModuleCategoryController extends BaseController
foreach ($list as $k => $v){
$v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM);
$v['url'] = $this->user['domain'].$v['route'];
if($this->user['is_upgrade'] == 1){
if($v['route'] != $moduleInfo['route']){
$v['url'] = $this->user['domain'].$moduleInfo['route']."_catalog/".$v['route'];
}
}
$list[$k] = $v;
}
}
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Bside\News;
use App\Enums\Common\Code;
use App\Helper\Arr;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\News\News;
use App\Models\News\NewsCategory;
... ... @@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic
if(isset($param['image'])){
$param['image'] = str_replace_url($param['image'] ?? '');
}
if(isset($param['related_news_id'])){
$param['related_news_id'] = implode(',',$param['related_news_id']);
}
if(isset($this->param['id'])){
$param['operator_id'] = $this->user['id'];
}else{
... ... @@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic
$this->fail('发布时间需大于当天');
}
}
if(isset($param['related_news_id'])){
$param['related_news_id'] = implode(',',$param['related_news_id']);
}
return $this->success($param);
}
... ...
... ... @@ -9,6 +9,7 @@
namespace App\Models\Com;
use App\Helper\Arr;
use App\Models\Base;
class KeywordVideoTask extends Base
... ... @@ -17,4 +18,10 @@ class KeywordVideoTask extends Base
const STATUS_CLOSE = 1;//停止
protected $table = 'gl_keyword_video_task';
public function getTemplateDataAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
}
... ...
... ... @@ -348,12 +348,13 @@ Route::middleware(['aloginauth'])->group(function () {
* 生成视频的项目
*/
Route::prefix('keyword_video')->group(function () {
Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('keyword_video_lists');
Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask');
Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit');
Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog');
Route::any('/taskNum', [Aside\Com\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum');
Route::any('/getVideoCount', [Aside\Com\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount');
Route::any('/', [Aside\KeywordVideo\KeywordVideoController::class, 'lists'])->name('keyword_video_lists');
Route::any('/createKeywordTask', [Aside\KeywordVideo\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask');
Route::any('/edit', [Aside\KeywordVideo\KeywordVideoController::class, 'edit'])->name('keyword_video_edit');
Route::any('/getVideoTaskLog', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog');
Route::any('/taskNum', [Aside\KeywordVideo\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum');
Route::any('/getVideoCount', [Aside\KeywordVideo\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount');
Route::any('/get_template', [Aside\KeywordVideo\KeywordVideoController::class, 'get_template'])->name('keyword_get_template');
});
// 公共主题模版
... ...