|
...
|
...
|
@@ -10,25 +10,38 @@ |
|
|
|
namespace App\Http\Controllers\Bside;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Models\CustomModule\CustomModuleContent;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class TestController extends BaseController
|
|
|
|
{
|
|
|
|
public function ceshi(){
|
|
|
|
ProjectServer::useProject(2209);
|
|
|
|
$title_str = $this->datas();
|
|
|
|
$title_array = preg_split("/\r\n|\n|\r/", $title_str);
|
|
|
|
$title_count = count($title_array);
|
|
|
|
$des_str = $this->data2();
|
|
|
|
$des_array = preg_split("/\r\n|\n|\r/", $des_str);
|
|
|
|
$des_count = count($des_array);
|
|
|
|
$brand_str = $this->data3();
|
|
|
|
$brand_array = preg_split("/\r\n|\n|\r/", $brand_str);
|
|
|
|
$brand_count = count($brand_array);
|
|
|
|
$count = [
|
|
|
|
'title_count'=>$title_count,
|
|
|
|
'des_count'=>$des_count,
|
|
|
|
'brand_count'=>$brand_count
|
|
|
|
];
|
|
|
|
$this->response('success',Code::SUCCESS,$count);
|
|
|
|
for ($i = 0;$i < $title_count;$i++){
|
|
|
|
$data = [
|
|
|
|
'module_id' => 7,
|
|
|
|
'name'=>$title_array[$i],
|
|
|
|
'remark'=>$brand_array[$i],
|
|
|
|
'content'=>$des_array[$i],
|
|
|
|
'route'=>$title_array[$i],
|
|
|
|
];
|
|
|
|
$customModel = new CustomModuleContent();
|
|
|
|
$id = $customModel->addReturnId($data);
|
|
|
|
$route = RouteMap::setRoute($title_array[$i], RouteMap::SOURCE_MODULE,
|
|
|
|
$id, 2209);
|
|
|
|
$customModel->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
public function datas(){
|
|
|
|
return 'Cat. NO.кот. Нет.
|
|
...
|
...
|
@@ -1816,8 +1829,7 @@ TA12S05-2546WT'; |
|
|
|
}
|
|
|
|
|
|
|
|
public function data2(){
|
|
|
|
return 'Description
|
|
|
|
EXCEL 5 AQ 250 X 4.6MM
|
|
|
|
return 'EXCEL 5 AQ 250 X 4.6MM
|
|
|
|
HPLC COLUMN ACE EXCEL C18 150 * 4.6 MM, 3 µM
|
|
|
|
UMC-5 CLIP, MTG, UNIV. 2-2 1/2INCH OD
|
|
|
|
UMC-4 CLIP, MTG, UNIV. 1 5/8-1 7/8IN OD
|
...
|
...
|
|