作者 刘锟

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

@@ -26,7 +26,7 @@ class UpgradeProjectCount extends Command @@ -26,7 +26,7 @@ class UpgradeProjectCount extends Command
26 * 26 *
27 * @var string 27 * @var string
28 */ 28 */
29 - protected $signature = 'upgrade_month_count'; 29 + protected $signature = 'upgrade_month_count {project_id}';
30 30
31 /** 31 /**
32 * The console command description. 32 * The console command description.
@@ -36,13 +36,12 @@ class UpgradeProjectCount extends Command @@ -36,13 +36,12 @@ class UpgradeProjectCount extends Command
36 protected $description = '升级项目统计'; 36 protected $description = '升级项目统计';
37 37
38 public function handle(){ 38 public function handle(){
39 - $project_id = 769; 39 + $project_id = $this->argument('project_id');
40 $oldModel = new UpdateOldInfo(); 40 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 41 $info = $oldModel->read(['project_id'=>$project_id]);
42 $url = $info['old_domain_online']; 42 $url = $info['old_domain_online'];
43 ProjectServer::useProject($project_id); 43 ProjectServer::useProject($project_id);
44 $this->count($project_id,$url); 44 $this->count($project_id,$url);
45 -  
46 DB::disconnect('custom_mysql'); 45 DB::disconnect('custom_mysql');
47 } 46 }
48 47
@@ -55,7 +55,7 @@ class UpdateRoute extends Command @@ -55,7 +55,7 @@ class UpdateRoute extends Command
55 */ 55 */
56 public function handle(){ 56 public function handle(){
57 $projectModel = new Project(); 57 $projectModel = new Project();
58 - $list = $projectModel->list(['id'=>645]); 58 + $list = $projectModel->list(['id'=>264]);
59 $data = []; 59 $data = [];
60 foreach ($list as $v){ 60 foreach ($list as $v){
61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
@@ -300,4 +300,28 @@ class ComController extends BaseController @@ -300,4 +300,28 @@ class ComController extends BaseController
300 } 300 }
301 $this->response('success',Code::SUCCESS,['url'=>$url_link]); 301 $this->response('success',Code::SUCCESS,['url'=>$url_link]);
302 } 302 }
  303 +
  304 + /**
  305 + * @remark :根据手机号码,获取当前号码拥有的所有项目
  306 + * @name :getMobileProject
  307 + * @author :lyh
  308 + * @method :post
  309 + * @time :2024/2/22 9:32
  310 + */
  311 + public function getMobileProject(){
  312 + $data = [];
  313 + $userModel = new User();
  314 + $list = $userModel->list(['mobile'=>$this->user['mobile'],'project_id'=>['!=',$this->user['project_id']]],'id',['id','project_id']);
  315 + if(!empty($list)){
  316 + $projectModel = new Project();
  317 + foreach ($list as $k => $v){
  318 + $projectInfo = $projectModel->read(['id'=>$v['project_id']],['id','company']);
  319 + //获取当前项目详情
  320 + $data[] = ['project_id'=>$projectInfo['id'],'company'=>$projectInfo['company']];
  321 + }
  322 + }
  323 + //登录选择项目的有效时间
  324 + Cache::add('login-project-'.$this->user['mobile'],1,300);
  325 + $this->response('success',Code::SUCCESS,$data);
  326 + }
303 } 327 }
@@ -43,6 +43,10 @@ class DomainInfoLogic extends BaseLogic @@ -43,6 +43,10 @@ class DomainInfoLogic extends BaseLogic
43 if(isset($this->param['id']) && !empty($this->param['id'])){ 43 if(isset($this->param['id']) && !empty($this->param['id'])){
44 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 44 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
45 }else{ 45 }else{
  46 + //查看域名是否以WWW开头
  47 + if (strpos($this->param['domain'], 'www.') === 0) {
  48 + $this->param['other_domain'] = json_encode([str_replace('www', '*', $this->param['domain']),str_replace('www.', '', $this->param['domain'])]);
  49 + }
46 $rs = $this->model->add($this->param); 50 $rs = $this->model->add($this->param);
47 } 51 }
48 if($rs === false){ 52 if($rs === false){
@@ -386,4 +386,5 @@ class UserLoginLogic @@ -386,4 +386,5 @@ class UserLoginLogic
386 throw new AsideGlobalException($code, $message); 386 throw new AsideGlobalException($code, $message);
387 } 387 }
388 388
  389 +
389 } 390 }
@@ -19,6 +19,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -19,6 +19,7 @@ Route::middleware(['bloginauth'])->group(function () {
19 Route::any('/get_project', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_project'])->name('get_project'); 19 Route::any('/get_project', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_project'])->name('get_project');
20 Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken'); 20 Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken');
21 Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink'); 21 Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink');
  22 + Route::any('/getMobileProject', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getMobileProject'])->name('getMobileProject');
22 //用户相关路由 23 //用户相关路由
23 Route::prefix('user')->group(function () { 24 Route::prefix('user')->group(function () {
24 Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); 25 Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists');