diff --git a/app-ht/modules/device/controllers/DeviceController.php b/app-ht/modules/device/controllers/DeviceController.php index ad89553..3318d7a 100644 --- a/app-ht/modules/device/controllers/DeviceController.php +++ b/app-ht/modules/device/controllers/DeviceController.php @@ -847,9 +847,9 @@ class DeviceController extends BaseController $trans = Yii::$app->getDb()->beginTransaction(); try { $newDeviceModel->device_id = $deviceId; - $newDeviceModel->status = DeviceStatus::HAS_AUTH; + $newDeviceModel->status = DeviceStatus::NO_AUTH; $newDeviceModel->apply_at = $tt ; - $newDeviceModel->auth_at = $tt; + //$newDeviceModel->auth_at = $tt; $newDeviceModel->save(); $deviceFailModel->is_delete = 1; $deviceFailModel->save(); diff --git a/app-ht/modules/manufacturer/controllers/ManufacturerController.php b/app-ht/modules/manufacturer/controllers/ManufacturerController.php index 334a0af..207160d 100644 --- a/app-ht/modules/manufacturer/controllers/ManufacturerController.php +++ b/app-ht/modules/manufacturer/controllers/ManufacturerController.php @@ -103,7 +103,7 @@ class ManufacturerController extends BaseController $request = Yii::$app->request; $name = $request->post("name"); $phone = $request->post("phone"); - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '厂商名称不能为空'); return $this->render('create'); } @@ -156,7 +156,7 @@ class ManufacturerController extends BaseController $params = $this->dataList(1); return $this->render('index', $params); } - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '厂商名称不能为空'); return $this->render('edit', ["isCreateSuccess" => false, "info" => $manufacturer]); } diff --git a/app-ht/modules/manufacturer/views/manufacturer/create.php b/app-ht/modules/manufacturer/views/manufacturer/create.php index 400e6f8..0e613fb 100644 --- a/app-ht/modules/manufacturer/views/manufacturer/create.php +++ b/app-ht/modules/manufacturer/views/manufacturer/create.php @@ -17,13 +17,13 @@ $this->params['breadcrumbs'][] = $this->title;
- +
- +
@@ -51,8 +51,8 @@ $this->params['breadcrumbs'][] = $this->title; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); var b = $("input[name='phone']").val(); - if (a == ""){ - alert("用户名称不能为空"); + if ($.trim(a) == ""){ + alert("厂商名称不能为空"); return false; } if (!new RegExp("^0?(13|15|18|14|17)[0-9]{9}$").test(b)){ diff --git a/app-ht/modules/manufacturer/views/manufacturer/edit.php b/app-ht/modules/manufacturer/views/manufacturer/edit.php index f0a74f1..b9d053a 100644 --- a/app-ht/modules/manufacturer/views/manufacturer/edit.php +++ b/app-ht/modules/manufacturer/views/manufacturer/edit.php @@ -27,19 +27,19 @@ $this->params['breadcrumbs'][] = $this->title;
- " name="name" placeholder="请填写厂商名称" class="form-control"> + " name="name" placeholder="请填写厂商名称" class="form-control" autocomplete="off">
- " name="phone" placeholder="请填写联系电话" class="form-control" > + " name="phone" placeholder="请填写联系电话" class="form-control" autocomplete="off">
- " name="username" placeholder="请填写账号名称" class="form-control" > + " name="username" placeholder="请填写账号名称" class="form-control" autocomplete="off">
@@ -76,7 +76,7 @@ $this->params['breadcrumbs'][] = $this->title; var b = $("input[name='phone']").val(); var c = $("input[name='username']").val(); var d = $("input[name='password']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("用户名称不能为空"); return false; } @@ -84,12 +84,12 @@ $this->params['breadcrumbs'][] = $this->title; alert("请填写正确的手机号码"); return false; } - if (c == ""){ + if ($.trim(c) == ""){ alert("账号不能为空"); $("input[name='username']").focus(); return false; } - if (d == ""){ + if ($.trim(d) == ""){ alert("密码不能为空"); return false; } diff --git a/app-ht/modules/manufacturer/views/manufacturer/index.php b/app-ht/modules/manufacturer/views/manufacturer/index.php index f546108..35186d5 100644 --- a/app-ht/modules/manufacturer/views/manufacturer/index.php +++ b/app-ht/modules/manufacturer/views/manufacturer/index.php @@ -25,11 +25,11 @@ $this->params['breadcrumbs'][] = $this->title; 厂商名称: - + 联系电话: - + 账号: - + 厂商添加开始时间: diff --git a/app-ht/modules/model/controllers/ModelController.php b/app-ht/modules/model/controllers/ModelController.php index 9ac15ba..e2410a1 100644 --- a/app-ht/modules/model/controllers/ModelController.php +++ b/app-ht/modules/model/controllers/ModelController.php @@ -91,7 +91,7 @@ class ModelController extends BaseController { $request = Yii::$app->request; $name = $request->post("name"); // 机器型号 - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '机器型号不能为空'); return $this->render('create'); } @@ -140,7 +140,7 @@ class ModelController extends BaseController $params = $this->dataList(1); return $this->render('index', $params); } - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '机器型号不能为空'); return $this->render('edit', ["info" => $model]); } diff --git a/app-ht/modules/model/views/model/create.php b/app-ht/modules/model/views/model/create.php index 11774af..d0b3db7 100644 --- a/app-ht/modules/model/views/model/create.php +++ b/app-ht/modules/model/views/model/create.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
- +
@@ -44,7 +44,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("机器型号不能为空"); return false; } diff --git a/app-ht/modules/model/views/model/edit.php b/app-ht/modules/model/views/model/edit.php index 9212bf8..51ef8c8 100644 --- a/app-ht/modules/model/views/model/edit.php +++ b/app-ht/modules/model/views/model/edit.php @@ -20,7 +20,7 @@ $this->params['breadcrumbs'][] = $this->title;
- " style="margin-top: -6px;" name="name" placeholder="请填写机器型号" class="form-control"> + " style="margin-top: -6px;" name="name" placeholder="请填写机器型号" class="form-control" autocomplete="off">
@@ -48,7 +48,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("机器型号不能为空"); return false; } diff --git a/app-ht/modules/model/views/model/index.php b/app-ht/modules/model/views/model/index.php index 7efb824..2d59923 100644 --- a/app-ht/modules/model/views/model/index.php +++ b/app-ht/modules/model/views/model/index.php @@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title; 机器型号
- +
创建时间 diff --git a/app-ht/modules/production/controllers/ProductionController.php b/app-ht/modules/production/controllers/ProductionController.php index 765b6a1..4050e9f 100644 --- a/app-ht/modules/production/controllers/ProductionController.php +++ b/app-ht/modules/production/controllers/ProductionController.php @@ -147,7 +147,7 @@ class ProductionController extends BaseController $params = $this->dataList(1); return $this->render('index', $params); } - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '生产日期不能为空'); return $this->render('edit', ["info" => $production]); } diff --git a/app-ht/modules/production/views/production/create.php b/app-ht/modules/production/views/production/create.php index 0e362dc..d336ffd 100644 --- a/app-ht/modules/production/views/production/create.php +++ b/app-ht/modules/production/views/production/create.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
- +
@@ -44,7 +44,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("生产日期不能为空"); return false; } diff --git a/app-ht/modules/production/views/production/edit.php b/app-ht/modules/production/views/production/edit.php index 7633bac..9902966 100644 --- a/app-ht/modules/production/views/production/edit.php +++ b/app-ht/modules/production/views/production/edit.php @@ -48,7 +48,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("生产日期不能为空"); return false; } diff --git a/app-ht/modules/project/controllers/ProjectController.php b/app-ht/modules/project/controllers/ProjectController.php index fb03108..035a497 100644 --- a/app-ht/modules/project/controllers/ProjectController.php +++ b/app-ht/modules/project/controllers/ProjectController.php @@ -140,7 +140,7 @@ class ProjectController extends BaseController $params = $this->dataList(1); return $this->render('index', $params); } - if (empty($name)) { + if (empty(trim($name))) { Yii::$app->session->setFlash('error', '项目不能为空'); return $this->render('edit', ["info" => $Project]); } diff --git a/app-ht/modules/project/views/project/create.php b/app-ht/modules/project/views/project/create.php index 5d0821f..7c66d7d 100644 --- a/app-ht/modules/project/views/project/create.php +++ b/app-ht/modules/project/views/project/create.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
- +
@@ -44,7 +44,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("项目名称不能为空"); return false; } diff --git a/app-ht/modules/project/views/project/edit.php b/app-ht/modules/project/views/project/edit.php index 6da1bfc..f408598 100644 --- a/app-ht/modules/project/views/project/edit.php +++ b/app-ht/modules/project/views/project/edit.php @@ -48,7 +48,7 @@ $this->params['breadcrumbs'][] = $this->title; var getUrl = ''; $('#myFrom').attr('action', getUrl); var a = $("input[name='name']").val(); - if (a == ""){ + if ($.trim(a) == ""){ alert("项目名称不能为空"); return false; } diff --git a/app-ht/modules/project/views/project/index.php b/app-ht/modules/project/views/project/index.php index c19d137..f16ea31 100644 --- a/app-ht/modules/project/views/project/index.php +++ b/app-ht/modules/project/views/project/index.php @@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title; 项目名称
- +
创建时间 diff --git a/domain/manufacturer/Manufacturer.php b/domain/manufacturer/Manufacturer.php index d473f09..f5c63fc 100644 --- a/domain/manufacturer/Manufacturer.php +++ b/domain/manufacturer/Manufacturer.php @@ -26,8 +26,8 @@ class Manufacturer try { $manufacturerModel = Yii::createObject(ManufacturerModel::className()); $manufacturerModel->manufacture_no = self::getManufactureNo(); - $manufacturerModel->name = $item["name"]; // 厂商名称 - $manufacturerModel->phone = $item['phone']; + $manufacturerModel->name = trim($item["name"]); // 厂商名称 + $manufacturerModel->phone = trim($item['phone']); $result = $manufacturerModel->save(); $saveResult = false; if ($result) { @@ -87,6 +87,9 @@ class Manufacturer if (empty($sysUserModel)) { return false; } + if (isset($item['name'])) { + $item['name'] = trim($item['name']); + } if (isset($item['name']) && !empty($item['name'])) { $manufacturerModel->name = $item['name']; } diff --git a/domain/model/Model.php b/domain/model/Model.php index 87c98ab..ff22d7f 100644 --- a/domain/model/Model.php +++ b/domain/model/Model.php @@ -20,7 +20,10 @@ class Model static function create($item) { try { - $findModelModel = ModelModel::findOne(['name' => $item["name"]]); + if (isset($item['name'])) { + $item['name'] = trim($item["name"]); + } + $findModelModel = ModelModel::findOne(['name' => $item['name']]); if (!empty($findModelModel)) { return -1; } @@ -46,6 +49,9 @@ class Model if (empty($modelModel)) { return false; } + if (isset($item['name'])) { + $item['name'] = trim($item["name"]); + } if (isset($item['name']) && $modelModel->name != $item['name']) { $findModelModel = ModelModel::findOne(['name' => $item["name"]]); if (!empty($findModelModel)) { diff --git a/domain/production/Production.php b/domain/production/Production.php index 20b6481..e21388b 100644 --- a/domain/production/Production.php +++ b/domain/production/Production.php @@ -46,6 +46,9 @@ class Production if (empty($productionModel)) { return false; } + if (isset($item['name'])) { + $item['name'] = trim($item["name"]); + } if (isset($item['name']) && $productionModel->name != $item['name']) { $findProductionModel = ProductionModel::findOne(['name' => $item["name"]]); if (!empty($findProductionModel)) { diff --git a/domain/project/Project.php b/domain/project/Project.php index a93a0cb..0ee308a 100644 --- a/domain/project/Project.php +++ b/domain/project/Project.php @@ -20,6 +20,9 @@ class Project static function create($item) { try { + if (isset($item['name'])) { + $item['name'] = trim($item['name']); + } $findProjectModel = ProjectModel::findOne(['name' => $item["name"]]); if (!empty($findProjectModel)) { return -1; @@ -46,6 +49,9 @@ class Project if (empty($projectModel)) { return false; } + if (isset($item['name'])) { + $item['name'] = trim($item['name']); + } if (isset($item['name']) && $projectModel->name != $item['name']) { $findProjectModel = ProjectModel::findOne(['name' => $item["name"]]); if (!empty($findProjectModel)) { -- libgit2 0.21.0