Commit 8174084d authored by clone's avatar clone

bug

parent a91b1ed3
...@@ -56,13 +56,13 @@ class Version extends Basic ...@@ -56,13 +56,13 @@ class Version extends Basic
$param["app_path"] = $_POST["app_path"]; $param["app_path"] = $_POST["app_path"];
$param["is_update"] = $_POST["is_update"]; $param["is_update"] = $_POST["is_update"];
if (!isset($param["version_no"]) || !isset($param["type"])) { if (empty($param["version_no"]) || empty($param["type"])) {
$this->response("101", "版本号或app类型不能为空"); $this->response("101", "版本号或app类型不能为空");
} }
if ($param["type"] == 0 || $param["type"] == 2 && isset($param["app_path"])) { if ($param["type"] == 0 || $param["type"] == 2 && isset($param["app_path"])) {
$this->response("101", "安卓请上传安装包"); $this->response("101", "安卓请上传安装包");
} }
if (!isset($param["is_update"])) { if (empty($param["is_update"])) {
$this->response("101", "是否强制更新为必填"); $this->response("101", "是否强制更新为必填");
} }
$param["create_time"] = date("Y-m-d H:i:s", time()); $param["create_time"] = date("Y-m-d H:i:s", time());
......
...@@ -67,19 +67,16 @@ ...@@ -67,19 +67,16 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" style="text-align: right">强制更新:</label> <label class="col-sm-3 control-label" style="text-align: right">是否强制更新:</label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="radio" style="display: inline-block"> <div class="radio" style="display: inline-block">
<label> <label>
<input type="radio" name="isUpdateRadios" id="is_update_1" value="0" <input type="radio" name="isUpdateRadios" id="is_update_1" value="0" checked>非强制更新
checked>强制更新
</label> </label>
</div> </div>
<div class="radio" style="display: inline-block"> <div class="radio" style="display: inline-block">
<label> <label>
<input type="radio" name="isUpdateRadios" id="is_update_2" <input type="radio" name="isUpdateRadios" id="is_update_2" value="1">强制更新
value="1">非强制更新
</label> </label>
</div> </div>
</div> </div>
......
...@@ -37,7 +37,7 @@ class AppVersion extends Model ...@@ -37,7 +37,7 @@ class AppVersion extends Model
public function getVersionList() public function getVersionList()
{ {
$param["is_del"] = 0; $param["is_del"] = 0;
return $this->field("id,version_no,IF(type = 1,'ios','android') as type ,create_time,intro,app_path,IF(is_update = 1,'是','否') as is_update") return $this->field("id,version_no,IF(type = 1 || type =3,'ios','android') as type ,create_time,intro,app_path,IF(is_update = 1,'是','否') as is_update")
->where($param) ->where($param)
->order("id desc") ->order("id desc")
->select(); ->select();
......
...@@ -25,7 +25,7 @@ define(['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStart ...@@ -25,7 +25,7 @@ define(['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStart
params.version_no = $("#version_no").val(); params.version_no = $("#version_no").val();
params.app_path = $("#cover_image").val(); params.app_path = $("#cover_image").val();
params.intro = $("#intro").val(); params.intro = $("#intro").val();
params.isUpdate = $("input[name = isUpdateRadios]:checked").val(); params.is_update = $("input[name = isUpdateRadios]:checked").val();
if (!params.type || params.type == null) { if (!params.type || params.type == null) {
alert("类型不能为空"); alert("类型不能为空");
...@@ -39,7 +39,7 @@ define(['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStart ...@@ -39,7 +39,7 @@ define(['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStart
alert("下载地址不能为空"); alert("下载地址不能为空");
return false; return false;
} }
if (!params.isUpdate || params.isUpdate == null) { if (!params.is_update || params.is_update == null) {
alert("是否强制更新不能为空"); alert("是否强制更新不能为空");
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment