作者 lyh

gx

... ... @@ -5,7 +5,6 @@ namespace App\Console\Commands\YesterdayCount;
use App\Helper\Common;
use App\Helper\FormGlobalsoApi;
use App\Models\CustomerVisit\CustomerVisitItem;
use App\Models\HomeCount\Count as CountMo;
use App\Models\Project\DeployBuild;
use Carbon\Carbon;
use Illuminate\Console\Command;
... ... @@ -64,8 +63,7 @@ class Yesterday extends Command
$data[] = $arr;
}
//判断数据是否存在
$countModel = new CountModel();
$countModel->insert($data);
DB::table('gl_count')->insert($data);
echo $this->error;
}
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Helper\Common;
use App\Http\Controllers\Controller;
use App\Http\Requests\Bside\Nav\NavRequest;
use App\Http\Requests\Scene;
use App\Models\Project\DeployBuild;
use App\Models\User\User as UserModel;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
... ... @@ -209,5 +210,16 @@ class BaseController extends Controller
return \Illuminate\Support\Facades\Request::isMethod('post');
}
/**
* @name :(获取当前登录用户域名)projectUrl
* @author :lyh
* @method :post
* @time :2023/6/6 14:09
*/
public function projectUrlNotify($param){
$deployBuildModel = new DeployBuild();
$info = $deployBuildModel->read(['project_id'=>$this->user['project_id']]);
$url = $info['test_domain'].'/api/updateHtmlNotify?model='.$param;
return http_get($url);
}
}
... ...
... ... @@ -12,6 +12,8 @@ use App\Models\Blog\Blog as BlogModel;
class BlogController extends BaseController
{
//通知别名
public $model = 'blog';
/**
* @name :博客列表
* @return json
... ... @@ -70,7 +72,8 @@ class BlogController extends BaseController
public function add(BlogRequest $request,BlogLogic $blogLogic){
$request->validated();
$blogLogic->blog_add();
//TODO::通知
//TODO::通知网站更新
$this->projectUrlNotify($this->model);
$this->response('success');
}
... ... @@ -86,7 +89,8 @@ class BlogController extends BaseController
'id.required' => 'ID不能为空'
]);
$blogLogic->blog_edit();
//TODO::通知
//TODO::通知网站更新
$this->projectUrlNotify($this->model);
$this->response('success');
}
... ...
... ... @@ -17,6 +17,7 @@ use Illuminate\Support\Facades\DB;
*/
class NewsController extends BaseController
{
public $model = 'news';
/**
* @name :获取新闻列表
* @return json
... ... @@ -70,6 +71,8 @@ class NewsController extends BaseController
public function add(NewsRequest $newsRequest,NewsLogic $newsLogic){
$newsRequest->validated();
$newsLogic->news_add();
//TODO::通知网站更新
$this->projectUrlNotify($this->model);
$this->response('success');
}
... ... @@ -86,6 +89,8 @@ class NewsController extends BaseController
'id.required' => 'ID不能为空',
]);
$newsLogic->news_edit();
//TODO::通知网站更新
$this->projectUrlNotify($this->model);
$this->response('success');
}
... ...
... ... @@ -30,10 +30,10 @@ class LoginAuthMiddleware
return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']);
}
// 设置数据信息
// $project = ProjectServer::useProject($info['project_id']);
// if(empty($project)){
// return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']);
// }
$project = ProjectServer::useProject($info['project_id']);
if(empty($project)){
return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']);
}
//操作权限设置
$projectRoleModel = new ProjectRoleModel();
$role_info = $projectRoleModel->read(['id'=>$info['role_id']]);
... ...