Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
6 个修改的文件
包含
334 行增加
和
173 行删除
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :ImportCustomModule.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/12/9 11:35 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands\CustomModule; | ||
| 11 | + | ||
| 12 | +use App\Models\CustomModule\CustomModuleCategory; | ||
| 13 | +use App\Models\CustomModule\CustomModuleContent; | ||
| 14 | +use App\Models\CustomModule\CustomModuleExtentContent; | ||
| 15 | +use App\Models\RouteMap\RouteMap; | ||
| 16 | +use App\Services\ProjectServer; | ||
| 17 | +use Illuminate\Console\Command; | ||
| 18 | +use Illuminate\Support\Facades\DB; | ||
| 19 | + | ||
| 20 | +class ImportCustomModule extends Command | ||
| 21 | +{ | ||
| 22 | + /** | ||
| 23 | + * The name and signature of the console command. | ||
| 24 | + * | ||
| 25 | + * @var string | ||
| 26 | + */ | ||
| 27 | + protected $signature = 'import_custom_module'; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * The console command description. | ||
| 31 | + * | ||
| 32 | + * @var string | ||
| 33 | + */ | ||
| 34 | + protected $description = 'import_custom_module'; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @remark :导入 | ||
| 38 | + * @name :handle | ||
| 39 | + * @author :lyh | ||
| 40 | + * @method :post | ||
| 41 | + * @time :2024/12/9 11:36 | ||
| 42 | + */ | ||
| 43 | + public function handle(){ | ||
| 44 | + echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL; | ||
| 45 | + ProjectServer::useProject(2837); | ||
| 46 | + $this->import_module_content(); | ||
| 47 | + DB::disconnect('custom_mysql'); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * @remark :导入扩展模块 (保留) | ||
| 52 | + * @name :ceshis | ||
| 53 | + * @author :lyh | ||
| 54 | + * @method :post | ||
| 55 | + * @time :2024/12/6 17:02 | ||
| 56 | + */ | ||
| 57 | + public function import_module_content(){ | ||
| 58 | + $data = 'MBR10100CT,Rectifier/Schottky Barrier Rectifier,TO-220AB,100,5*2,common cathode,100,0.85,10,2500,175,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR10100CT.pdf | ||
| 59 | +MBR2060BCT,Rectifier/Schottky Barrier Rectifier,ITO-220AB,60,10*2,common cathode,150,0.75,50,5000,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR2060BCT.pdf | ||
| 60 | +MBR20150DCT,Rectifier/Schottky Barrier Rectifier,TO-263(D2PAK),150,10*2,common cathode,150,0.88,5,1500,175,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR20150DCT.pdf | ||
| 61 | +MUR2060CT,Rectifier/High Efficient Rectifier,TO-220AB,600,10*2,common cathode,150,1.7,1,500,150,50,Active,https://v6-file.globalso.com/upload/p/2837/files/MUR2060CT.pdf | ||
| 62 | +MUR2040FCT,Rectifier/High Efficient Rectifier,ITO-220AB,400,10*2,common cathode,150,1.3,1,500,150,50,Active,https://v6-file.globalso.com/upload/p/2837/files/MUR2040FCT.pdf | ||
| 63 | +DSEK20S04B,Rectifier/Ultra fast soft Recovery Rectifier,TO-252(DPAK),400,10*2,common cathode,125,1.25,2,500,175,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK20S04B.pdf | ||
| 64 | +DSEK30S06D,Rectifier/Ultra fast soft Recovery Rectifier,TO-263(D2PAK),600,15*2,common cathode,150,1.7,2,500,175,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK30S06D.pdf | ||
| 65 | +DSEK60H06P,Rectifier/Ultra fast soft Recovery Rectifier,TO-247AD,600,30*2,common cathode,300,1.7,5,500,175,60,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK60H06P.pdf | ||
| 66 | +GBU410,Rectifier/Bridge Rectifier,GBU,1000,4,-,125,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU410.pdf | ||
| 67 | +GBU1510,Rectifier/Bridge Rectifier,GBU,1000,15,-,250,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1510.pdf | ||
| 68 | +GBJ2510,Rectifier/Bridge Rectifier,GBJ,1000,25,-,300,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2510.pdf | ||
| 69 | +GBU1504H,Rectifier/High Efficient Bridge Rectifier,GBU,400,15,-,150,1.3,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1504H.pdf | ||
| 70 | +GBU1506H,Rectifier/High Efficient Bridge Rectifier,GBU,400,15,-,150,1.7,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1506H.pdf | ||
| 71 | +GBJ2504H,Rectifier/High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.3,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2504H.pdf | ||
| 72 | +GBJ2506H,Rectifier/High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.7,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2506H.pdf | ||
| 73 | +1N4007,Rectifier/Standard Recovery Rectifier,DO-41,1000,1,-,50,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N4007.pdf | ||
| 74 | +1N5399,Rectifier/Standard Recovery Rectifier,DO-15,1000,1.5,-,75,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N5399.pdf | ||
| 75 | +1N5408,Rectifier/Standard Recovery Rectifier,DO-27,1000,3,-,100,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N5408.pdf | ||
| 76 | +RS1M,Rectifier/Fast Recovery Rectifier,SMA,1000,1,-,50,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS1M.pdf | ||
| 77 | +RS2M,Rectifier/Fast Recovery Rectifier,SMB,1000,2,-,75,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS2M.pdf | ||
| 78 | +RS3M,Rectifier/Fast Recovery Rectifier,SMC,1000,3,-,100,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS3M.pdf | ||
| 79 | +SF28,Rectifier/Super fast Recovery Rectifier,DO-15,600,2,-,60,1.7,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/SF28.pdf | ||
| 80 | +SF56G,Rectifier/Super fast Recovery Rectifier,DO-27,400,5,-,125,1.3,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/SF56G.pdf | ||
| 81 | +DSE1006,Rectifier/Super fast Recovery Rectifier,TO-220AC,600,10,Single Positive,150,1.7,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSE1006.pdf | ||
| 82 | +DSE1504F,Rectifier/Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSE1504F.pdf'; | ||
| 83 | + $array = explode("\n", $data); | ||
| 84 | + foreach ($array as $values){ | ||
| 85 | + $array1 = explode(',',$values); | ||
| 86 | + $contentData = [ | ||
| 87 | + 'name'=>$array1[0], | ||
| 88 | + 'route'=>'', | ||
| 89 | + 'project_id'=>2837, | ||
| 90 | + 'operator_id'=>6393, | ||
| 91 | + 'module_id'=>2, | ||
| 92 | + ]; | ||
| 93 | + $customModuleCategoryModel = new CustomModuleCategory(); | ||
| 94 | + if(!empty($array1[1])){ | ||
| 95 | + $cate_ids = ''; | ||
| 96 | + $cate_arr = explode('/',$array1[1]); | ||
| 97 | + echo date('Y-m-d H:i:s') . 'json_fenle:' . json_encode($cate_arr) . PHP_EOL; | ||
| 98 | + foreach ($cate_arr as $cateV){ | ||
| 99 | + $catInfo = $customModuleCategoryModel->read(['name'=>$cateV]); | ||
| 100 | + if($catInfo !== false){ | ||
| 101 | + $cate_ids = $cate_ids.','.$catInfo['id']; | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + echo date('Y-m-d H:i:s') . '处理后的fenle:' . $cate_ids . PHP_EOL; | ||
| 105 | + $contentData['category_id'] = empty($cate_ids) ? '' : $cate_ids.','; | ||
| 106 | + }else{ | ||
| 107 | + $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]); | ||
| 108 | + if($catInfo !== false){ | ||
| 109 | + $contentData['category_id'] = ','.$catInfo['id'].','; | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + $customModuleContentModel = new CustomModuleContent(); | ||
| 113 | + $contentId = $customModuleContentModel->addReturnId($contentData); | ||
| 114 | + $route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837); | ||
| 115 | + $customModuleContentModel->edit(['route'=>$route],['id'=>$contentId]); | ||
| 116 | + $pd_extended_field_arr = [ | ||
| 117 | + [ | ||
| 118 | + 'key'=>'pd_extended_field_1', | ||
| 119 | + 'type'=>1, | ||
| 120 | + 'project_id'=>2837, | ||
| 121 | + 'values'=>$array1[2], | ||
| 122 | + 'content_id'=>$contentId, | ||
| 123 | + 'module_id'=>2, | ||
| 124 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 125 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 126 | + ], | ||
| 127 | + [ | ||
| 128 | + 'key'=>'pd_extended_field_2', | ||
| 129 | + 'type'=>1, | ||
| 130 | + 'project_id'=>2837, | ||
| 131 | + 'values'=>$array1[3], | ||
| 132 | + 'module_id'=>2, | ||
| 133 | + 'content_id'=>$contentId, | ||
| 134 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 135 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 136 | + ], | ||
| 137 | + [ | ||
| 138 | + 'key'=>'pd_extended_field_3', | ||
| 139 | + 'type'=>1, | ||
| 140 | + 'project_id'=>2837, | ||
| 141 | + 'values'=>$array1[4], | ||
| 142 | + 'module_id'=>2, | ||
| 143 | + 'content_id'=>$contentId, | ||
| 144 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 145 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 146 | + ], | ||
| 147 | + [ | ||
| 148 | + 'key'=>'pd_extended_field_4', | ||
| 149 | + 'type'=>1, | ||
| 150 | + 'project_id'=>2837, | ||
| 151 | + 'values'=>$array1[5], | ||
| 152 | + 'module_id'=>2, | ||
| 153 | + 'content_id'=>$contentId, | ||
| 154 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 155 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 156 | + ], | ||
| 157 | + [ | ||
| 158 | + 'key'=>'pd_extended_field_5', | ||
| 159 | + 'type'=>1, | ||
| 160 | + 'project_id'=>2837, | ||
| 161 | + 'values'=>$array1[6], | ||
| 162 | + 'module_id'=>2, | ||
| 163 | + 'content_id'=>$contentId, | ||
| 164 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 165 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 166 | + ], | ||
| 167 | + [ | ||
| 168 | + 'key'=>'pd_extended_field_6', | ||
| 169 | + 'type'=>1, | ||
| 170 | + 'project_id'=>2837, | ||
| 171 | + 'values'=>$array1[7], | ||
| 172 | + 'module_id'=>2, | ||
| 173 | + 'content_id'=>$contentId, | ||
| 174 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 175 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 176 | + ], | ||
| 177 | + [ | ||
| 178 | + 'key'=>'pd_extended_field_7', | ||
| 179 | + 'type'=>1, | ||
| 180 | + 'project_id'=>2837, | ||
| 181 | + 'values'=>$array1[8], | ||
| 182 | + 'module_id'=>2, | ||
| 183 | + 'content_id'=>$contentId, | ||
| 184 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 185 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 186 | + ], | ||
| 187 | + [ | ||
| 188 | + 'key'=>'pd_extended_field_8', | ||
| 189 | + 'type'=>1, | ||
| 190 | + 'project_id'=>2837, | ||
| 191 | + 'values'=>$array1[9], | ||
| 192 | + 'module_id'=>2, | ||
| 193 | + 'content_id'=>$contentId, | ||
| 194 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 195 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 196 | + ], | ||
| 197 | + [ | ||
| 198 | + 'key'=>'pd_extended_field_9', | ||
| 199 | + 'type'=>1, | ||
| 200 | + 'project_id'=>2837, | ||
| 201 | + 'values'=>$array1[10], | ||
| 202 | + 'module_id'=>2, | ||
| 203 | + 'content_id'=>$contentId, | ||
| 204 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 205 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 206 | + ], | ||
| 207 | + [ | ||
| 208 | + 'key'=>'pd_extended_field_10', | ||
| 209 | + 'type'=>1, | ||
| 210 | + 'project_id'=>2837, | ||
| 211 | + 'values'=>$array1[11], | ||
| 212 | + 'module_id'=>2, | ||
| 213 | + 'content_id'=>$contentId, | ||
| 214 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 215 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 216 | + ], | ||
| 217 | + [ | ||
| 218 | + 'key'=>'pd_extended_field_11', | ||
| 219 | + 'type'=>1, | ||
| 220 | + 'project_id'=>2837, | ||
| 221 | + 'values'=>$array1[12], | ||
| 222 | + 'module_id'=>2, | ||
| 223 | + 'content_id'=>$contentId, | ||
| 224 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 225 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 226 | + ], | ||
| 227 | + [ | ||
| 228 | + 'key'=>'pd_extended_field_12', | ||
| 229 | + 'type'=>4, | ||
| 230 | + 'project_id'=>2837, | ||
| 231 | + 'values'=>json_encode([['url'=>$array1[13]]]), | ||
| 232 | + 'module_id'=>2, | ||
| 233 | + 'content_id'=>$contentId, | ||
| 234 | + 'created_at'=>date('Y-m-d H:i:s'), | ||
| 235 | + 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 236 | + ], | ||
| 237 | + ]; | ||
| 238 | + $extendContentModel = new CustomModuleExtentContent(); | ||
| 239 | + $extendContentModel->insert($pd_extended_field_arr); | ||
| 240 | + } | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | +} |
| @@ -6,15 +6,16 @@ use App\Helper\Arr; | @@ -6,15 +6,16 @@ use App\Helper\Arr; | ||
| 6 | use App\Models\Com\Notify; | 6 | use App\Models\Com\Notify; |
| 7 | use App\Models\Devops\ServerConfig; | 7 | use App\Models\Devops\ServerConfig; |
| 8 | use App\Models\Devops\ServersIp; | 8 | use App\Models\Devops\ServersIp; |
| 9 | +use App\Models\Domain\DomainCreateTask; | ||
| 9 | use App\Models\Domain\DomainInfo; | 10 | use App\Models\Domain\DomainInfo; |
| 10 | use App\Models\Product\Keyword; | 11 | use App\Models\Product\Keyword; |
| 11 | use App\Models\Product\KeywordRelated; | 12 | use App\Models\Product\KeywordRelated; |
| 12 | use App\Models\Product\Product; | 13 | use App\Models\Product\Product; |
| 14 | +use App\Models\Project\DeployBuild; | ||
| 13 | use App\Models\Project\Project; | 15 | use App\Models\Project\Project; |
| 14 | use App\Services\BatchExportService; | 16 | use App\Services\BatchExportService; |
| 15 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 16 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 17 | -use Symfony\Component\Process\Process; | ||
| 18 | 19 | ||
| 19 | class Temp extends Command | 20 | class Temp extends Command |
| 20 | { | 21 | { |
| @@ -33,6 +34,88 @@ class Temp extends Command | @@ -33,6 +34,88 @@ class Temp extends Command | ||
| 33 | protected $description = '临时脚本'; | 34 | protected $description = '临时脚本'; |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 37 | + * 伍欣组推广项目:开启AMP站点,首页不强制跳转,批量生成AMP站点页面 | ||
| 38 | + * @author Akun | ||
| 39 | + * @date 2024/12/10 10:43 | ||
| 40 | + */ | ||
| 41 | + public function handle() | ||
| 42 | + { | ||
| 43 | + //获取所有组内推广项目 | ||
| 44 | + $leader_mid = 16; | ||
| 45 | + $project_ids = DeployBuild::where('leader_mid', $leader_mid)->pluck('project_id')->toArray(); | ||
| 46 | + $project_list = Project::where('type', 2)->whereIn('id', $project_ids)->get(); | ||
| 47 | + | ||
| 48 | + $task_model = new DomainCreateTask(); | ||
| 49 | + foreach ($project_list as $project) { | ||
| 50 | + $project_id = $project->id; | ||
| 51 | + | ||
| 52 | + $this->output('项目id:' . $project_id . ',start'); | ||
| 53 | + | ||
| 54 | + //获取项目域名情况 | ||
| 55 | + $domain_info = DomainInfo::where('project_id', $project_id)->where('status', 1)->first(); | ||
| 56 | + if (!$domain_info) { | ||
| 57 | + $this->output('未绑定正式域名'); | ||
| 58 | + continue; | ||
| 59 | + } | ||
| 60 | + $domain_id = $domain_info->id; | ||
| 61 | + $domain = $domain_info->domain; | ||
| 62 | + | ||
| 63 | + //获取项目所在服务器 | ||
| 64 | + $serve_ip_info = ServersIp::where('id', $project->serve_id)->first(); | ||
| 65 | + if (!$serve_ip_info) { | ||
| 66 | + $this->output('未查询到服务器数据'); | ||
| 67 | + continue; | ||
| 68 | + } | ||
| 69 | + $servers_id = $serve_ip_info->servers_id; | ||
| 70 | + | ||
| 71 | + if ($servers_id == ServerConfig::SELF_SITE_ID) { | ||
| 72 | + $this->output('自建站项目过滤'); | ||
| 73 | + continue; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + //开启AMP站点 | ||
| 77 | + if ($domain_info->amp_status == 0) { | ||
| 78 | + $domain_info->amp_status = 1; | ||
| 79 | + $domain_info->amp_type = 1; | ||
| 80 | + } | ||
| 81 | + //首页不强制跳转 | ||
| 82 | + $domain_info->is_redirect = 0; | ||
| 83 | + $domain_info->save(); | ||
| 84 | + | ||
| 85 | + //创建主站建站任务 | ||
| 86 | + $task_model->add([ | ||
| 87 | + 'server_id' => $servers_id, | ||
| 88 | + 'project_id' => $project_id, | ||
| 89 | + 'domain_id' => $domain_id, | ||
| 90 | + 'type' => DomainCreateTask::TYPE_MAIN | ||
| 91 | + ]); | ||
| 92 | + | ||
| 93 | + //创建AMP站建站任务 | ||
| 94 | + $task_model->add([ | ||
| 95 | + 'server_id' => $servers_id, | ||
| 96 | + 'project_id' => $project_id, | ||
| 97 | + 'domain_id' => $domain_id, | ||
| 98 | + 'type' => DomainCreateTask::TYPE_AMP | ||
| 99 | + ]); | ||
| 100 | + | ||
| 101 | + //请求对应C端页面更新接口 | ||
| 102 | + $c_url = $domain . '/api/update_page/'; | ||
| 103 | + $c_params = [ | ||
| 104 | + 'project_id' => $project_id, | ||
| 105 | + 'type' => 3 | ||
| 106 | + ]; | ||
| 107 | + $re = http_post($c_url, json_encode($c_params), [], true); | ||
| 108 | + if (isset($re['status']) && $re['status'] == 200) { | ||
| 109 | + $this->output($c_url . ' | 请求成功'); | ||
| 110 | + } else { | ||
| 111 | + $this->output($c_url . ' | ' . ($re['message'] ?? '未返回失败原因')); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + $this->output('项目id:' . $project_id . ',end'); | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /** | ||
| 36 | * 关联所有项目关键词 | 119 | * 关联所有项目关键词 |
| 37 | * @author Akun | 120 | * @author Akun |
| 38 | * @date 2024/11/18 15:07 | 121 | * @date 2024/11/18 15:07 |
| @@ -236,7 +319,7 @@ class Temp extends Command | @@ -236,7 +319,7 @@ class Temp extends Command | ||
| 236 | * @author Akun | 319 | * @author Akun |
| 237 | * @date 2024/09/26 10:48 | 320 | * @date 2024/09/26 10:48 |
| 238 | */ | 321 | */ |
| 239 | - public function handle() | 322 | + public function handle1() |
| 240 | { | 323 | { |
| 241 | $notify_model = new Notify(); | 324 | $notify_model = new Notify(); |
| 242 | $project_model = new Project(); | 325 | $project_model = new Project(); |
| @@ -57,7 +57,7 @@ class UpdateRoute extends Command | @@ -57,7 +57,7 @@ class UpdateRoute extends Command | ||
| 57 | */ | 57 | */ |
| 58 | public function handle(){ | 58 | public function handle(){ |
| 59 | $projectModel = new Project(); | 59 | $projectModel = new Project(); |
| 60 | - $list = $projectModel->list(['id'=>['=',1423]]); | 60 | + $list = $projectModel->list(['id'=>['=',827]]); |
| 61 | $data = []; | 61 | $data = []; |
| 62 | foreach ($list as $v){ | 62 | foreach ($list as $v){ |
| 63 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 63 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -175,7 +175,7 @@ class FormGlobalsoApi | @@ -175,7 +175,7 @@ class FormGlobalsoApi | ||
| 175 | $data = [ | 175 | $data = [ |
| 176 | 'domain' => $domain, | 176 | 'domain' => $domain, |
| 177 | 'token' => $token, | 177 | 'token' => $token, |
| 178 | - 'source'=> $is_upgrade ? '1,2,3,4' : '1,3', | 178 | + 'source'=> $is_upgrade ? '1,2,3,4,5' : '1,3,5', |
| 179 | 'num'=>15, | 179 | 'num'=>15, |
| 180 | ]; | 180 | ]; |
| 181 | $queryString = http_build_query($data); | 181 | $queryString = http_build_query($data); |
| @@ -202,7 +202,7 @@ class FormGlobalsoApi | @@ -202,7 +202,7 @@ class FormGlobalsoApi | ||
| 202 | $data = [ | 202 | $data = [ |
| 203 | 'domain' => $url, | 203 | 'domain' => $url, |
| 204 | 'token' => $token, | 204 | 'token' => $token, |
| 205 | - 'source'=> $is_upgrade ? '1,2,3,4' : '1,3', | 205 | + 'source'=> $is_upgrade ? '1,2,3,4,5' : '1,3,5', |
| 206 | 'model' => 'month', | 206 | 'model' => 'month', |
| 207 | 'sta_date'=>$month, | 207 | 'sta_date'=>$month, |
| 208 | ]; | 208 | ]; |
| @@ -37,172 +37,5 @@ class TestController extends BaseController | @@ -37,172 +37,5 @@ class TestController extends BaseController | ||
| 37 | $this->response('success',Code::SUCCESS,[]); | 37 | $this->response('success',Code::SUCCESS,[]); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - /** | ||
| 41 | - * @remark :导入扩展模块 (保留) | ||
| 42 | - * @name :ceshis | ||
| 43 | - * @author :lyh | ||
| 44 | - * @method :post | ||
| 45 | - * @time :2024/12/6 17:02 | ||
| 46 | - */ | ||
| 47 | - public function ceshis(){ | ||
| 48 | - $data = 'MBR10100CT,Schottky Barrier Rectifier,TO-220AB,100,5*2,common cathode,100,0.85,10,2500,175,-,Active | ||
| 49 | -MBR2060BCT,Schottky Barrier Rectifier,ITO-220AB,60,10*2,common cathode,150,0.75,50,5000,150,-,Active | ||
| 50 | -MBR20150DCT,Schottky Barrier Rectifier,TO-263(D2PAK),150,10*2,common cathode,150,0.88,5,1500,175,-,Active | ||
| 51 | -MUR2060CT,High Efficient Rectifier,TO-220AB,600,10*2,common cathode,150,1.7,1,500,150,50,Active | ||
| 52 | -MUR2040FCT,High Efficient Rectifier,ITO-220AB,400,10*2,common cathode,150,1.3,1,500,150,50,Active | ||
| 53 | -DSEK20S04B,Ultra fast soft Recovery Rectifier,TO-252(DPAK),400,10*2,common cathode,125,1.25,2,500,175,35,Active | ||
| 54 | -DSEK30S06D,Ultra fast soft Recovery Rectifier,TO-263(D2PAK),600,15*2,common cathode,150,1.7,2,500,175,35,Active | ||
| 55 | -DSEK60H06P,Ultra fast soft Recovery Rectifier,TO-247AD,600,30*2,common cathode,300,1.7,5,500,175,60,Active | ||
| 56 | -GBU410,Bridge Rectifier,GBU,1000,4,-,125,1,1,500,150,-,Active | ||
| 57 | -GBU1510,Bridge Rectifier,GBU,1000,15,-,250,1,1,500,150,-,Active | ||
| 58 | -GBJ2510,Bridge Rectifier,GBJ,1000,25,-,300,1,1,500,150,-,Active | ||
| 59 | -GBU1504H,High Efficient Bridge Rectifier,GBU,400,15,-,150,1.3,1,500,150,-,Active | ||
| 60 | -GBU1506H,High Efficient Bridge Rectifier,GBU,400,15,-,150,1.7,1,500,150,-,Active | ||
| 61 | -GBJ2504H,High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.3,1,500,150,-,Active | ||
| 62 | -GBJ2506H,High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.7,1,500,150,-,Active | ||
| 63 | -1N4007,Standard Recovery Rectifier,DO-41,1000,1,-,50,1,1,500,150,-,Active | ||
| 64 | -1N5399,Standard Recovery Rectifier,DO-15,1000,1.5,-,75,1,1,500,150,-,Active | ||
| 65 | -1N5408,Standard Recovery Rectifier,DO-27,1000,3,-,100,1,1,500,150,-,Active | ||
| 66 | -RS1M,Fast Recovery Rectifier,SMA,1000,1,-,50,1.3,1,500,150,500,Active | ||
| 67 | -RS2M,Fast Recovery Rectifier,SMB,1000,2,-,75,1.3,1,500,150,500,Active | ||
| 68 | -RS3M,Fast Recovery Rectifier,SMC,1000,3,-,100,1.3,1,500,150,500,Active | ||
| 69 | -SF28,Super fast Recovery Rectifier,DO-15,600,2,-,60,1.7,1,500,150,35,Active | ||
| 70 | -SF56G,Super fast Recovery Rectifier,DO-27,400,5,-,125,1.3,1,500,150,35,Active | ||
| 71 | -DSE1006,Super fast Recovery Rectifier,TO-220AC,600,10,Single Positive,150,1.7,1,500,150,35,Active | ||
| 72 | -DSE1504F,Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4,1,500,150,35,Active'; | ||
| 73 | - $array = explode("\n", $data); | ||
| 74 | - foreach ($array as $values){ | ||
| 75 | - $array1 = explode(',',$values); | ||
| 76 | - $contentData = [ | ||
| 77 | - 'name'=>$array1[0], | ||
| 78 | - 'route'=>'', | ||
| 79 | - 'project_id'=>2837, | ||
| 80 | - 'operator_id'=>6393, | ||
| 81 | - 'module_id'=>2, | ||
| 82 | - ]; | ||
| 83 | - $customModuleCategoryModel = new CustomModuleCategory(); | ||
| 84 | - $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]); | ||
| 85 | - if($catInfo !== false){ | ||
| 86 | - $contentData['category_id'] = $catInfo['id']; | ||
| 87 | - } | ||
| 88 | - $customModuleContentModel = new CustomModuleContent(); | ||
| 89 | - $contentId = $customModuleContentModel->addReturnId($contentData); | ||
| 90 | - $route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837); | ||
| 91 | - $customModuleContentModel->edit(['route'=>$route],['id'=>$contentId]); | ||
| 92 | - $pd_extended_field_arr = [ | ||
| 93 | - [ | ||
| 94 | - 'key'=>'pd_extended_field_1', | ||
| 95 | - 'type'=>1, | ||
| 96 | - 'project_id'=>2837, | ||
| 97 | - 'values'=>$array1[2], | ||
| 98 | - 'content_id'=>$contentId, | ||
| 99 | - 'module_id'=>2, | ||
| 100 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 101 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 102 | - ], | ||
| 103 | - [ | ||
| 104 | - 'key'=>'pd_extended_field_2', | ||
| 105 | - 'type'=>1, | ||
| 106 | - 'project_id'=>2837, | ||
| 107 | - 'values'=>$array1[3], | ||
| 108 | - 'module_id'=>2, | ||
| 109 | - 'content_id'=>$contentId, | ||
| 110 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 111 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 112 | - ], | ||
| 113 | - [ | ||
| 114 | - 'key'=>'pd_extended_field_3', | ||
| 115 | - 'type'=>1, | ||
| 116 | - 'project_id'=>2837, | ||
| 117 | - 'values'=>$array1[4], | ||
| 118 | - 'module_id'=>2, | ||
| 119 | - 'content_id'=>$contentId, | ||
| 120 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 121 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 122 | - ], | ||
| 123 | - [ | ||
| 124 | - 'key'=>'pd_extended_field_4', | ||
| 125 | - 'type'=>1, | ||
| 126 | - 'project_id'=>2837, | ||
| 127 | - 'values'=>$array1[5], | ||
| 128 | - 'module_id'=>2, | ||
| 129 | - 'content_id'=>$contentId, | ||
| 130 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 131 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 132 | - ], | ||
| 133 | - [ | ||
| 134 | - 'key'=>'pd_extended_field_5', | ||
| 135 | - 'type'=>1, | ||
| 136 | - 'project_id'=>2837, | ||
| 137 | - 'values'=>$array1[6], | ||
| 138 | - 'module_id'=>2, | ||
| 139 | - 'content_id'=>$contentId, | ||
| 140 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 141 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 142 | - ], | ||
| 143 | - [ | ||
| 144 | - 'key'=>'pd_extended_field_6', | ||
| 145 | - 'type'=>1, | ||
| 146 | - 'project_id'=>2837, | ||
| 147 | - 'values'=>$array1[7], | ||
| 148 | - 'module_id'=>2, | ||
| 149 | - 'content_id'=>$contentId, | ||
| 150 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 151 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 152 | - ], | ||
| 153 | - [ | ||
| 154 | - 'key'=>'pd_extended_field_7', | ||
| 155 | - 'type'=>1, | ||
| 156 | - 'project_id'=>2837, | ||
| 157 | - 'values'=>$array1[8], | ||
| 158 | - 'module_id'=>2, | ||
| 159 | - 'content_id'=>$contentId, | ||
| 160 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 161 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 162 | - ], | ||
| 163 | - [ | ||
| 164 | - 'key'=>'pd_extended_field_8', | ||
| 165 | - 'type'=>1, | ||
| 166 | - 'project_id'=>2837, | ||
| 167 | - 'values'=>$array1[9], | ||
| 168 | - 'module_id'=>2, | ||
| 169 | - 'content_id'=>$contentId, | ||
| 170 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 171 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 172 | - ], | ||
| 173 | - [ | ||
| 174 | - 'key'=>'pd_extended_field_9', | ||
| 175 | - 'type'=>1, | ||
| 176 | - 'project_id'=>2837, | ||
| 177 | - 'values'=>$array1[10], | ||
| 178 | - 'module_id'=>2, | ||
| 179 | - 'content_id'=>$contentId, | ||
| 180 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 181 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 182 | - ], | ||
| 183 | - [ | ||
| 184 | - 'key'=>'pd_extended_field_10', | ||
| 185 | - 'type'=>1, | ||
| 186 | - 'project_id'=>2837, | ||
| 187 | - 'values'=>$array1[11], | ||
| 188 | - 'module_id'=>2, | ||
| 189 | - 'content_id'=>$contentId, | ||
| 190 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 191 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 192 | - ], | ||
| 193 | - [ | ||
| 194 | - 'key'=>'pd_extended_field_11', | ||
| 195 | - 'type'=>1, | ||
| 196 | - 'project_id'=>2837, | ||
| 197 | - 'values'=>$array1[12], | ||
| 198 | - 'module_id'=>2, | ||
| 199 | - 'content_id'=>$contentId, | ||
| 200 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 201 | - 'updated_at'=>date('Y-m-d H:i:s'), | ||
| 202 | - ], | ||
| 203 | - ]; | ||
| 204 | - $extendContentModel = new CustomModuleExtentContent(); | ||
| 205 | - $extendContentModel->insert($pd_extended_field_arr); | ||
| 206 | - } | ||
| 207 | - } | 40 | + |
| 208 | } | 41 | } |
| @@ -360,6 +360,8 @@ class UserLoginLogic | @@ -360,6 +360,8 @@ class UserLoginLogic | ||
| 360 | 'data'=>$info | 360 | 'data'=>$info |
| 361 | ]; | 361 | ]; |
| 362 | } | 362 | } |
| 363 | + Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(), | ||
| 364 | + 'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']); | ||
| 363 | return $this->success($data); | 365 | return $this->success($data); |
| 364 | } | 366 | } |
| 365 | 367 |
-
请 注册 或 登录 后发表评论