正在显示
4 个修改的文件
包含
34 行增加
和
4 行删除
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :RenewProjectController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/8/11 10:22 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Project; | ||
| 11 | + | ||
| 12 | +use App\Http\Controllers\Aside\BaseController; | ||
| 13 | +use App\Models\HomeCount\Count; | ||
| 14 | +use Carbon\Carbon; | ||
| 15 | + | ||
| 16 | +class RenewProjectController extends BaseController | ||
| 17 | +{ | ||
| 18 | + /** | ||
| 19 | + * @remark :获取所有服务天数小于15天的项目 | ||
| 20 | + * @name :lists | ||
| 21 | + * @author :lyh | ||
| 22 | + * @method :post | ||
| 23 | + * @time :2023/8/11 10:22 | ||
| 24 | + */ | ||
| 25 | + public function lists(){ | ||
| 26 | + $count = new Count(); | ||
| 27 | + $yesterday = Carbon::yesterday()->toDateString(); | ||
| 28 | + $count_list = $count->list(['date'=>$yesterday,'service_day'=>['<=',15]],'id',['project_id']); | ||
| 29 | + $arr = []; | ||
| 30 | + } | ||
| 31 | +} |
| @@ -112,6 +112,7 @@ class ServerConfigLogic extends BaseLogic | @@ -112,6 +112,7 @@ class ServerConfigLogic extends BaseLogic | ||
| 112 | $data['serve_id'] = $res; | 112 | $data['serve_id'] = $res; |
| 113 | }else{ | 113 | }else{ |
| 114 | $data['mysql_id'] = $res; | 114 | $data['mysql_id'] = $res; |
| 115 | + //$this->initializationMysql($this->param); | ||
| 115 | } | 116 | } |
| 116 | $project->edit($data,['id'=>$this->param['project_id']]); | 117 | $project->edit($data,['id'=>$this->param['project_id']]); |
| 117 | return true; | 118 | return true; |
| @@ -117,8 +117,8 @@ class MenuLogic extends BaseLogic | @@ -117,8 +117,8 @@ class MenuLogic extends BaseLogic | ||
| 117 | * @method :post | 117 | * @method :post |
| 118 | * @time :2023/7/25 14:17 | 118 | * @time :2023/7/25 14:17 |
| 119 | */ | 119 | */ |
| 120 | - public function roleMenuList(){ | ||
| 121 | - $lists = $this->model->list(); | 120 | + public function roleMenuList($map = []){ |
| 121 | + $lists = $this->model->list($map,'sort'); | ||
| 122 | $menu = array(); | 122 | $menu = array(); |
| 123 | foreach ($lists as $k => $v){ | 123 | foreach ($lists as $k => $v){ |
| 124 | $v = (array)$v; | 124 | $v = (array)$v; |
| @@ -72,7 +72,6 @@ class ProjectServer extends BaseService | @@ -72,7 +72,6 @@ class ProjectServer extends BaseService | ||
| 72 | public static function initTable($project) | 72 | public static function initTable($project) |
| 73 | { | 73 | { |
| 74 | $database_name = DB::connection('custom_tmp_mysql')->getDatabaseName(); | 74 | $database_name = DB::connection('custom_tmp_mysql')->getDatabaseName(); |
| 75 | - | ||
| 76 | $table = Schema::connection('custom_tmp_mysql')->getAllTables(); | 75 | $table = Schema::connection('custom_tmp_mysql')->getAllTables(); |
| 77 | $table = array_column($table, 'Tables_in_' . $database_name); | 76 | $table = array_column($table, 'Tables_in_' . $database_name); |
| 78 | foreach ($table as $v) { | 77 | foreach ($table as $v) { |
| @@ -80,7 +79,6 @@ class ProjectServer extends BaseService | @@ -80,7 +79,6 @@ class ProjectServer extends BaseService | ||
| 80 | if ($has_table) { | 79 | if ($has_table) { |
| 81 | continue; | 80 | continue; |
| 82 | } | 81 | } |
| 83 | - | ||
| 84 | $sql = DB::connection('custom_tmp_mysql')->select("SHOW CREATE TABLE {$v}"); | 82 | $sql = DB::connection('custom_tmp_mysql')->select("SHOW CREATE TABLE {$v}"); |
| 85 | DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); | 83 | DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); |
| 86 | } | 84 | } |
-
请 注册 或 登录 后发表评论