@@ -48,22 +62,22 @@ $this->params['breadcrumbs'][] = $this->title;
-
@@ -88,6 +102,14 @@ $this->params['breadcrumbs'][] = $this->title;
}
});
});
+ $('.package_type').click(function(e){
+ var thisVal = $(this).val();
+ if(2 == thisVal) {
+ $('.version_range').show();
+ } else {
+ $('.version_range').hide();
+ }
+ })
$("#save").bind("click", function () {
var getUrl = '=Url::toRoute("/upgrade/upgrade/do-push-app")?>';
@@ -109,14 +131,13 @@ $this->params['breadcrumbs'][] = $this->title;
alert("请选择升级方式");
return false;
}
- if (start_version == ""){
- alert("请填写开始版本号");
- return false;
- }
- if (end_version == ""){
- alert("请填写结束版本号");
- return false;
+ if (2 == package_type) {
+ if (start_version == ""){
+ alert("请填写开始版本号");
+ return false;
+ }
}
+
var cb = $("#myFrom").validate().form();
if (!cb){
return;
diff --git a/console/controllers/TestController.php b/console/controllers/TestController.php
index 76a8f83..917816e 100644
--- a/console/controllers/TestController.php
+++ b/console/controllers/TestController.php
@@ -119,8 +119,8 @@ class TestController extends Controller
public function actionCheckOtaUpdate()
{
//actionCheckAppVersion
- $url = 'http://47.107.95.101/app-api/web/checkOtaVersion';
- //$url = 'http://kingb:8012/app-api/web/checkOtaVersion';
+ //$url = 'http://47.107.95.101/app-api/web/checkOtaVersion';
+ $url = 'http://kingb:8012/app-api/web/checkOtaVersion';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DGDEVBICEID00001',
@@ -128,7 +128,7 @@ class TestController extends Controller
'hardware_version' => 'V1.0.1',
];
$params = json_encode($params);
- $params = '{"barcode":"0001000100010001","device_id":"DEVICEID00001","software_version":"V1.00.1A.20191002","hardware_version":""}';
+ //$params = '{"barcode":"0001000100010001","device_id":"DEVICEID00001","software_version":"V1.00.1A.20191002","hardware_version":""}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
diff --git a/domain/device/CreateBatchRepository.php b/domain/device/CreateBatchRepository.php
index f6a52ec..4b8482e 100644
--- a/domain/device/CreateBatchRepository.php
+++ b/domain/device/CreateBatchRepository.php
@@ -33,37 +33,35 @@ class CreateBatchRepository
{
if ('manufacture' == $type) {
$q = new Query();
- $q->select('id,manufacture_no, name');
+ $q->select(['concat(id, "_", manufacture_no) as uid', 'id','manufacture_no', 'name']);
$q->from('manufacture');
- $q->where('name like "%'.$keyword.'%" or manufacture_no like "%'.$keyword.'%"');
- $q->limit(20);
+ $q->where('id >1');
+
$list = $q->all();
return $list;
} elseif('project' == $type) {
$q = new Query();
- $q->select('id,project_no, name');
+ $q->select(['concat(id,"_", project_no) as uid', 'id','project_no', 'name']);
$q->from('project');
- $q->where('name like "%'.$keyword.'%" or project_no like "%'.$keyword.'%"');
- $q->limit(20);
+ $q->where('id >1');
+
$list = $q->all();
return $list;
} elseif ('model' == $type) {
$q = new Query();
- $q->select('id,model_no, name');
+ $q->select(['concat(id,"_", model_no) as uid','id','model_no', 'name']);
$q->from('model');
- $q->where('name like "%'.$keyword.'%" or model_no like "%'.$keyword.'%"');
- $q->limit(20);
+ $q->where('id >1');
$list = $q->all();
return $list;
} elseif ('production' == $type) {
$q = new Query();
- $q->select('id,production_no, name');
+ $q->select(['concat(id,"_", production_no) as uid','id','production_no', 'name']);
$q->from('production');
- $q->where('name like "%'.$keyword.'%" or production_no like "%'.$keyword.'%"');
- $q->limit(20);
+ $q->where('id >1');
$list = $q->all();
return $list;
diff --git a/domain/upgrade/Upgrade.php b/domain/upgrade/Upgrade.php
index 1b733ec..49a2fbf 100644
--- a/domain/upgrade/Upgrade.php
+++ b/domain/upgrade/Upgrade.php
@@ -20,20 +20,30 @@ class Upgrade
static function create($item)
{
try {
- $findUpgradeModel = UpgradeModel::findOne(['version' => $item["version"], 'manufacture_id' => $item["manufacture_id"], 'type' => $item["type"]]);
+ $where = [
+ 'version' => $item["version"],
+ 'manufacture_id' => $item["manufacture_id"],
+ 'project_id' => $item["project_id"],
+ 'model_id' => $item["model_id"],
+ 'type' => $item["type"]
+ ];
+ $findUpgradeModel = UpgradeModel::findOne($where);
if (!empty($findUpgradeModel)) {
return -1;
}
$upgradeModel = Yii::createObject(UpgradeModel::className());
- $upgradeModel->type = $item["type"]; // 版本类型 1. app类升级,2. OTA整包升级
- $upgradeModel->version = $item["version"]; // 版本
- $upgradeModel->manufacture_id = $item["manufacture_id"]; // 厂商编号
- $upgradeModel->path = $item["path"]; // 文件路径
- $upgradeModel->package_name = $item["package_name"]; // 安装包名称
+ $upgradeModel->type = $item["type"]; // 版本类型 1. app类升级,2. OTA整包升级
+ $upgradeModel->version = $item["version"]; // 版本
+ $upgradeModel->manufacture_id = $item["manufacture_id"]; // 厂商编号
+ $upgradeModel->project_id = $item["project_id"]; // 项目
+ $upgradeModel->model_id = $item["model_id"]; // 型号
+ $upgradeModel->desc = $item["desc"]; // 描述
+ $upgradeModel->path = $item["path"]; // 文件路径
+ $upgradeModel->package_name = $item["package_name"]; // 安装包名称
if (isset($item["device_ids"])) {
$upgradeModel->device_ids = $item["指定deviceID,可以多个,多个用逗号隔开"]; // 版本
}
- $upgradeModel->size = $item["size"]; // 文件大小
+ $upgradeModel->size = $item["size"]; // 文件大小
$upgradeModel->file_md5 = $item["file_md5"]; // 软件包校验用的md5
$saveResult = $upgradeModel->save();
return $saveResult;
@@ -66,6 +76,15 @@ class Upgrade
if (isset($item['manufacture_id']) && !empty($item['manufacture_id'])) {
$upgradeModel->manufacture_id = $item['manufacture_id'];
}
+ if (isset($item['project_id']) && !empty($item['project_id'])) {
+ $upgradeModel->project_id = $item['project_id'];
+ }
+ if (isset($item['model_id']) && !empty($item['model_id'])) {
+ $upgradeModel->model_id = $item['model_id'];
+ }
+ if (isset($item['desc']) && !empty($item['desc'])) {
+ $upgradeModel->desc = $item['desc'];
+ }
if (isset($item['path']) && !empty($item['path'])) {
$upgradeModel->path = $item['path'];
}
diff --git a/environments/dev/app-ht/config/params-local.php b/environments/dev/app-ht/config/params-local.php
index 04062ae..a50fc61 100644
--- a/environments/dev/app-ht/config/params-local.php
+++ b/environments/dev/app-ht/config/params-local.php
@@ -3,6 +3,5 @@ return [
/**
* 基础 CSS JS 的路径
*/
- 'assetsUrl' => 'http://localhost/jw/src/app-ht/web',//
- 'supervisorUrl' =>'http://120.24.157.206:9001/', // 用于多任务分发模板消息和短信队列的Supervisor网页管理后台地址
+ 'assetsUrl' => 'http://47.107.95.101/app-ht/web/',
];
diff --git a/environments/dev/common/config/main-local.php b/environments/dev/common/config/main-local.php
index b8e3434..77ff301 100644
--- a/environments/dev/common/config/main-local.php
+++ b/environments/dev/common/config/main-local.php
@@ -1,9 +1,9 @@
'yii\db\Connection',
- 'dsn' => 'mysql:host=localhost;dbname=ota',
+ 'dsn' => 'mysql:host=127.0.0.1;dbname=authorization',
'username' => 'root',
- 'password' => '123456',
+ 'password' => 'kb@2019',
'charset' => 'utf8',
];
diff --git a/environments/prod/app-api/config/main-local.php b/environments/prod/app-api/config/main-local.php
index d2d3633..4f30418 100644
--- a/environments/prod/app-api/config/main-local.php
+++ b/environments/prod/app-api/config/main-local.php
@@ -3,7 +3,7 @@ $config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
- 'cookieValidationKey' => '',
+ 'cookieValidationKey' => 'YdCyYvm8eOZZsaNRa_idrGimyTbsEQ8R',
],
],
];
diff --git a/environments/prod/app-ht/config/params-local.php b/environments/prod/app-ht/config/params-local.php
index bad396d..219b46c 100644
--- a/environments/prod/app-ht/config/params-local.php
+++ b/environments/prod/app-ht/config/params-local.php
@@ -3,5 +3,5 @@ return [
/**
* 基础 CSS JS 的路径
*/
- 'assetsUrl' => 'http://47.107.95.101/app-ht/web',
+ 'assetsUrl' => 'http://47.107.95.101/app-ht/web/',
];
\ No newline at end of file
diff --git a/environments/prod/common/config/main-local.php b/environments/prod/common/config/main-local.php
index ae286b8..77ff301 100644
--- a/environments/prod/common/config/main-local.php
+++ b/environments/prod/common/config/main-local.php
@@ -1,7 +1,7 @@
'yii\db\Connection',
- 'dsn' => 'mysql:host=localhost;dbname=authorization',
+ 'dsn' => 'mysql:host=127.0.0.1;dbname=authorization',
'username' => 'root',
'password' => 'kb@2019',
'charset' => 'utf8',
diff --git a/environments/test/common/config/main-local.php b/environments/test/common/config/main-local.php
index b821494..77ff301 100644
--- a/environments/test/common/config/main-local.php
+++ b/environments/test/common/config/main-local.php
@@ -1,7 +1,7 @@
'yii\db\Connection',
- 'dsn' => 'mysql:host=localhost;dbname=ota',
+ 'dsn' => 'mysql:host=127.0.0.1;dbname=authorization',
'username' => 'root',
'password' => 'kb@2019',
'charset' => 'utf8',
--
libgit2 0.21.0