作者 刘锟

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

... ... @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount;
use App\Helper\FormGlobalsoApi;
use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\HomeCount\MonthCount;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
... ... @@ -39,7 +40,13 @@ class UpgradeProjectCount extends Command
$project_id = $this->argument('project_id');
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id'=>$project_id]);
$url = $info['old_domain_online'];
if($info !== false){
$url = $info['old_domain_online'];
}else{
$domainModel = new DomainInfo();
$info = $domainModel->read(['project_id'=>$project_id]);
$url = $info['domain'];
}
ProjectServer::useProject($project_id);
$this->count($project_id,$url);
DB::disconnect('custom_mysql');
... ...
... ... @@ -9,7 +9,9 @@
namespace App\Http\Controllers\Aside\Com;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\Com\PromotionKeyword;
class KeywordController extends BaseController
{
... ... @@ -20,19 +22,19 @@ class KeywordController extends BaseController
* @method :post
* @time :2024/2/26 9:24
*/
public function savePromotionKeyword(){
public function createKeywordTask(){
$this->request->validate([
'data' => 'required|array',
'project_id'=>'required',
'number'=>'required'
], [
'data.required' => '自定义询盘数据不为空',
'data.array' => '必须为数组',
'project_id.required' => '项目唯一标识不为空',
'number.required' => 'number不为空',
]);
foreach ($this->param['data'] as $v){
$param['keyword'] = $v;
$param['project_id'] = $this->param['project_id'];
$keywordModel = new PromotionKeyword();
$rs = $keywordModel->add($this->param);
if($rs === false){
$this->response('添加失败',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}
... ...
... ... @@ -30,6 +30,7 @@ class MonthCountLogic extends BaseLogic
*/
public function getCountLists($map,$order = 'created_at',$filed = ['*']){
$map['project_id'] = $this->user['project_id'];
$new = $this->currentMonthCount();
$lists = $this->model->list($map,$order,$filed,'desc',10);
if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
foreach ($lists as $k => $v){
... ... @@ -44,10 +45,11 @@ class MonthCountLogic extends BaseLogic
}
}
$v['source_country'] = json_encode(array_values($source_country));
$v['total'] = $new['total'] ?? $v['total'];
$lists[$k] = $v;
}
}
$lists['new'] = $this->currentMonthCount();
$lists['new'] = $new;
return $this->success($lists);
}
... ...
... ... @@ -326,6 +326,13 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/del', [\App\Http\Controllers\Aside\CustomModule\CustomModuleController::class, 'del'])->name('custom_del');
});
/**
* 生成视频的项目
*/
Route::prefix('promotion_keyword')->group(function () {
Route::any('/createKeywordTask', [Aside\Com\KeywordController::class, 'createKeywordTask'])->name('promotion_keyword_createKeywordTask');
});
// 公共主题模版
Route::prefix('template')->group(function () {
Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists');
... ...