正在显示
5 个修改的文件
包含
29 行增加
和
10 行删除
| @@ -5,7 +5,6 @@ namespace App\Console\Commands\YesterdayCount; | @@ -5,7 +5,6 @@ namespace App\Console\Commands\YesterdayCount; | ||
| 5 | use App\Helper\Common; | 5 | use App\Helper\Common; |
| 6 | use App\Helper\FormGlobalsoApi; | 6 | use App\Helper\FormGlobalsoApi; |
| 7 | use App\Models\CustomerVisit\CustomerVisitItem; | 7 | use App\Models\CustomerVisit\CustomerVisitItem; |
| 8 | -use App\Models\HomeCount\Count as CountMo; | ||
| 9 | use App\Models\Project\DeployBuild; | 8 | use App\Models\Project\DeployBuild; |
| 10 | use Carbon\Carbon; | 9 | use Carbon\Carbon; |
| 11 | use Illuminate\Console\Command; | 10 | use Illuminate\Console\Command; |
| @@ -64,8 +63,7 @@ class Yesterday extends Command | @@ -64,8 +63,7 @@ class Yesterday extends Command | ||
| 64 | $data[] = $arr; | 63 | $data[] = $arr; |
| 65 | } | 64 | } |
| 66 | //判断数据是否存在 | 65 | //判断数据是否存在 |
| 67 | - $countModel = new CountModel(); | ||
| 68 | - $countModel->insert($data); | 66 | + DB::table('gl_count')->insert($data); |
| 69 | echo $this->error; | 67 | echo $this->error; |
| 70 | } | 68 | } |
| 71 | } | 69 | } |
| @@ -7,6 +7,7 @@ use App\Helper\Common; | @@ -7,6 +7,7 @@ use App\Helper\Common; | ||
| 7 | use App\Http\Controllers\Controller; | 7 | use App\Http\Controllers\Controller; |
| 8 | use App\Http\Requests\Bside\Nav\NavRequest; | 8 | use App\Http\Requests\Bside\Nav\NavRequest; |
| 9 | use App\Http\Requests\Scene; | 9 | use App\Http\Requests\Scene; |
| 10 | +use App\Models\Project\DeployBuild; | ||
| 10 | use App\Models\User\User as UserModel; | 11 | use App\Models\User\User as UserModel; |
| 11 | use Illuminate\Http\JsonResponse; | 12 | use Illuminate\Http\JsonResponse; |
| 12 | use Illuminate\Http\Request; | 13 | use Illuminate\Http\Request; |
| @@ -209,5 +210,16 @@ class BaseController extends Controller | @@ -209,5 +210,16 @@ class BaseController extends Controller | ||
| 209 | return \Illuminate\Support\Facades\Request::isMethod('post'); | 210 | return \Illuminate\Support\Facades\Request::isMethod('post'); |
| 210 | } | 211 | } |
| 211 | 212 | ||
| 212 | - | 213 | + /** |
| 214 | + * @name :(获取当前登录用户域名)projectUrl | ||
| 215 | + * @author :lyh | ||
| 216 | + * @method :post | ||
| 217 | + * @time :2023/6/6 14:09 | ||
| 218 | + */ | ||
| 219 | + public function projectUrlNotify($param){ | ||
| 220 | + $deployBuildModel = new DeployBuild(); | ||
| 221 | + $info = $deployBuildModel->read(['project_id'=>$this->user['project_id']]); | ||
| 222 | + $url = $info['test_domain'].'/api/updateHtmlNotify?model='.$param; | ||
| 223 | + return http_get($url); | ||
| 224 | + } | ||
| 213 | } | 225 | } |
| @@ -12,6 +12,8 @@ use App\Models\Blog\Blog as BlogModel; | @@ -12,6 +12,8 @@ use App\Models\Blog\Blog as BlogModel; | ||
| 12 | 12 | ||
| 13 | class BlogController extends BaseController | 13 | class BlogController extends BaseController |
| 14 | { | 14 | { |
| 15 | + //通知别名 | ||
| 16 | + public $model = 'blog'; | ||
| 15 | /** | 17 | /** |
| 16 | * @name :博客列表 | 18 | * @name :博客列表 |
| 17 | * @return json | 19 | * @return json |
| @@ -70,7 +72,8 @@ class BlogController extends BaseController | @@ -70,7 +72,8 @@ class BlogController extends BaseController | ||
| 70 | public function add(BlogRequest $request,BlogLogic $blogLogic){ | 72 | public function add(BlogRequest $request,BlogLogic $blogLogic){ |
| 71 | $request->validated(); | 73 | $request->validated(); |
| 72 | $blogLogic->blog_add(); | 74 | $blogLogic->blog_add(); |
| 73 | - //TODO::通知 | 75 | + //TODO::通知网站更新 |
| 76 | + $this->projectUrlNotify($this->model); | ||
| 74 | $this->response('success'); | 77 | $this->response('success'); |
| 75 | } | 78 | } |
| 76 | 79 | ||
| @@ -86,7 +89,8 @@ class BlogController extends BaseController | @@ -86,7 +89,8 @@ class BlogController extends BaseController | ||
| 86 | 'id.required' => 'ID不能为空' | 89 | 'id.required' => 'ID不能为空' |
| 87 | ]); | 90 | ]); |
| 88 | $blogLogic->blog_edit(); | 91 | $blogLogic->blog_edit(); |
| 89 | - //TODO::通知 | 92 | + //TODO::通知网站更新 |
| 93 | + $this->projectUrlNotify($this->model); | ||
| 90 | $this->response('success'); | 94 | $this->response('success'); |
| 91 | } | 95 | } |
| 92 | 96 |
| @@ -17,6 +17,7 @@ use Illuminate\Support\Facades\DB; | @@ -17,6 +17,7 @@ use Illuminate\Support\Facades\DB; | ||
| 17 | */ | 17 | */ |
| 18 | class NewsController extends BaseController | 18 | class NewsController extends BaseController |
| 19 | { | 19 | { |
| 20 | + public $model = 'news'; | ||
| 20 | /** | 21 | /** |
| 21 | * @name :获取新闻列表 | 22 | * @name :获取新闻列表 |
| 22 | * @return json | 23 | * @return json |
| @@ -70,6 +71,8 @@ class NewsController extends BaseController | @@ -70,6 +71,8 @@ class NewsController extends BaseController | ||
| 70 | public function add(NewsRequest $newsRequest,NewsLogic $newsLogic){ | 71 | public function add(NewsRequest $newsRequest,NewsLogic $newsLogic){ |
| 71 | $newsRequest->validated(); | 72 | $newsRequest->validated(); |
| 72 | $newsLogic->news_add(); | 73 | $newsLogic->news_add(); |
| 74 | + //TODO::通知网站更新 | ||
| 75 | + $this->projectUrlNotify($this->model); | ||
| 73 | $this->response('success'); | 76 | $this->response('success'); |
| 74 | } | 77 | } |
| 75 | 78 | ||
| @@ -86,6 +89,8 @@ class NewsController extends BaseController | @@ -86,6 +89,8 @@ class NewsController extends BaseController | ||
| 86 | 'id.required' => 'ID不能为空', | 89 | 'id.required' => 'ID不能为空', |
| 87 | ]); | 90 | ]); |
| 88 | $newsLogic->news_edit(); | 91 | $newsLogic->news_edit(); |
| 92 | + //TODO::通知网站更新 | ||
| 93 | + $this->projectUrlNotify($this->model); | ||
| 89 | $this->response('success'); | 94 | $this->response('success'); |
| 90 | } | 95 | } |
| 91 | 96 |
| @@ -30,10 +30,10 @@ class LoginAuthMiddleware | @@ -30,10 +30,10 @@ class LoginAuthMiddleware | ||
| 30 | return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']); | 30 | return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']); |
| 31 | } | 31 | } |
| 32 | // 设置数据信息 | 32 | // 设置数据信息 |
| 33 | -// $project = ProjectServer::useProject($info['project_id']); | ||
| 34 | -// if(empty($project)){ | ||
| 35 | -// return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']); | ||
| 36 | -// } | 33 | + $project = ProjectServer::useProject($info['project_id']); |
| 34 | + if(empty($project)){ | ||
| 35 | + return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']); | ||
| 36 | + } | ||
| 37 | //操作权限设置 | 37 | //操作权限设置 |
| 38 | $projectRoleModel = new ProjectRoleModel(); | 38 | $projectRoleModel = new ProjectRoleModel(); |
| 39 | $role_info = $projectRoleModel->read(['id'=>$info['role_id']]); | 39 | $role_info = $projectRoleModel->read(['id'=>$info['role_id']]); |
-
请 注册 或 登录 后发表评论