Commit 907c39d8c9043cb1d23ca053ad8b28ba05310b9d
1 parent
701576b7
Exists in
master
app-ht
1. F 调整上传日期的筛选条件
Showing
8 changed files
with
28 additions
and
24 deletions
Show diff stats
app-ht/modules/device/views/device/delete-index.php
@@ -82,6 +82,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -82,6 +82,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
82 | </div> | 82 | </div> |
83 | <div class="form-group col-sm-12" style="text-align: center;"> | 83 | <div class="form-group col-sm-12" style="text-align: center;"> |
84 | <button type="submit" class="btn btn-primary font-1" id="submitFilterBtn">查询</button> | 84 | <button type="submit" class="btn btn-primary font-1" id="submitFilterBtn">查询</button> |
85 | + <a class="btn btn-default btncls" href="<?=Url::toRoute(["/device/delete-index"])?>">重 置</a> | ||
85 | </div> | 86 | </div> |
86 | </form> | 87 | </form> |
87 | </div> | 88 | </div> |
app-ht/modules/device/views/device/index.php
@@ -83,6 +83,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -83,6 +83,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
83 | 83 | ||
84 | <div class="form-group col-sm-12" style="text-align: center;"> | 84 | <div class="form-group col-sm-12" style="text-align: center;"> |
85 | <button type="submit" class="btn btn-primary font-1" id="submitFilterBtn">查询</button> | 85 | <button type="submit" class="btn btn-primary font-1" id="submitFilterBtn">查询</button> |
86 | + <a class="btn btn-default btncls" href="<?=Url::toRoute(["/device/device/index"])?>">重 置</a> | ||
86 | <a class="btn btn-default" href="javascript:void(0)" id="btn-export"> 导出数据 </a> | 87 | <a class="btn btn-default" href="javascript:void(0)" id="btn-export"> 导出数据 </a> |
87 | </div> | 88 | </div> |
88 | </form> | 89 | </form> |
app-ht/modules/production/controllers/ProductionController.php
@@ -33,34 +33,32 @@ class ProductionController extends BaseController | @@ -33,34 +33,32 @@ class ProductionController extends BaseController | ||
33 | protected function dataList($type = '') | 33 | protected function dataList($type = '') |
34 | { | 34 | { |
35 | $request = Yii::$app->request; | 35 | $request = Yii::$app->request; |
36 | - $creatTime = $request->get('creatTime'); | 36 | + $createTime = $request->get('createTime'); |
37 | $endTime = $request->get('endTime'); | 37 | $endTime = $request->get('endTime'); |
38 | - $productionCreatTime = $request->get('productionCreatTime'); | ||
39 | - $productionEndTime = $request->get('productionEndTime'); | 38 | + $productionStartDate = $request->get('productionStartDate'); |
39 | + $productionEndDate = $request->get('productionEndDate'); | ||
40 | 40 | ||
41 | $gets = [ | 41 | $gets = [ |
42 | - 'creatTime' => $creatTime, | 42 | + 'createTime' => $createTime, |
43 | 'endTime' => $endTime, | 43 | 'endTime' => $endTime, |
44 | - 'productionCreatTime' => $productionCreatTime, | ||
45 | - 'productionEndTime' => $productionEndTime, | 44 | + 'productionStartDate' => $productionStartDate, |
45 | + 'productionEndDate' => $productionEndDate, | ||
46 | ]; | 46 | ]; |
47 | 47 | ||
48 | $where = ['and']; | 48 | $where = ['and']; |
49 | - if ($creatTime) { | ||
50 | - $creatTime = strtotime($creatTime); | ||
51 | - $where[] = ['>=', 'p.created_at', $creatTime]; | 49 | + if ($createTime) { |
50 | + $createTime = strtotime($createTime); | ||
51 | + $where[] = ['>=', 'p.created_at', $createTime]; | ||
52 | } | 52 | } |
53 | if ($endTime) { | 53 | if ($endTime) { |
54 | $endTime = strtotime($endTime) + 86400; | 54 | $endTime = strtotime($endTime) + 86400; |
55 | $where[] = ['<=', 'p.created_at', $endTime]; | 55 | $where[] = ['<=', 'p.created_at', $endTime]; |
56 | } | 56 | } |
57 | - if ($productionCreatTime) { | ||
58 | - $productionCreatTime = strtotime($productionCreatTime); | ||
59 | - $where[] = ['>=', 'p.name', $productionCreatTime]; | 57 | + if ($productionStartDate) { |
58 | + $where[] = ['>=', 'p.name', $productionStartDate]; | ||
60 | } | 59 | } |
61 | - if ($productionEndTime) { | ||
62 | - $productionEndTime = strtotime($productionEndTime) + 86400; | ||
63 | - $where[] = ['<=', 'p.name', $productionEndTime]; | 60 | + if ($productionEndDate) { |
61 | + $where[] = ['<=', 'p.name', $productionEndDate]; | ||
64 | } | 62 | } |
65 | if ($type == 0) { | 63 | if ($type == 0) { |
66 | $pageList = ProductionRepository::getPageList($where, 0 , 0); | 64 | $pageList = ProductionRepository::getPageList($where, 0 , 0); |
@@ -97,7 +95,7 @@ class ProductionController extends BaseController | @@ -97,7 +95,7 @@ class ProductionController extends BaseController | ||
97 | public function actionDoAdd() | 95 | public function actionDoAdd() |
98 | { | 96 | { |
99 | $request = Yii::$app->request; | 97 | $request = Yii::$app->request; |
100 | - $name = $request->post("name"); // 生产日期 | 98 | + $name = trim($request->post("name")); // 生产日期 |
101 | if (empty($name)) { | 99 | if (empty($name)) { |
102 | Yii::$app->session->setFlash('error', '生产日期不能为空'); | 100 | Yii::$app->session->setFlash('error', '生产日期不能为空'); |
103 | return $this->render('create'); | 101 | return $this->render('create'); |
app-ht/modules/production/views/production/create.php
@@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
17 | <div class="form-group col-sm-12"> | 17 | <div class="form-group col-sm-12"> |
18 | <label for="skillName" class="col-sm-4 control-label text-right">生产日期:</label> | 18 | <label for="skillName" class="col-sm-4 control-label text-right">生产日期:</label> |
19 | <div class="col-sm-4 text-left"> | 19 | <div class="col-sm-4 text-left"> |
20 | - <input type="date" value="" name="name" placeholder="请输入生产日期(如:2019-10-28)" style="margin-top: -6px;" class="form-control"" autocomplete="off"> | 20 | + <input type="date" value="" name="name" placeholder="例如:2019-10-28" style="margin-top: -6px;" class="form-control"" autocomplete="off"> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
app-ht/modules/production/views/production/edit.php
@@ -18,9 +18,9 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -18,9 +18,9 @@ $this->params['breadcrumbs'][] = $this->title; | ||
18 | <h3>编辑生产日期</h3> | 18 | <h3>编辑生产日期</h3> |
19 | </div> | 19 | </div> |
20 | <div class="form-group col-sm-12"> | 20 | <div class="form-group col-sm-12"> |
21 | - <label for="skillName" class="col-sm-4 control-label text-right">生产日期:</label> | 21 | + <label for="production" class="col-sm-4 control-label text-right">生产日期:</label> |
22 | <div class="col-sm-4 text-left"> | 22 | <div class="col-sm-4 text-left"> |
23 | - <input type="text" value="<?= isset($info["name"]) ? $info["name"] : "" ?>" style="margin-top: -6px;" name="name" placeholder="请填写生产日期(如:2019-10-28)" class="form-control"> | 23 | + <input type="date" value="<?= isset($info["name"]) ? $info["name"] : "" ?>" style="margin-top: -6px;" name="name" placeholder="例如:2019-10-28" class="form-control"> |
24 | </div> | 24 | </div> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
app-ht/modules/production/views/production/index.php
@@ -27,15 +27,16 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -27,15 +27,16 @@ $this->params['breadcrumbs'][] = $this->title; | ||
27 | <td width="10%" class="text-right">生产日期:</td> | 27 | <td width="10%" class="text-right">生产日期:</td> |
28 | <td width="35%" class="text-left"> | 28 | <td width="35%" class="text-left"> |
29 | <div class="form-inline"> | 29 | <div class="form-inline"> |
30 | - <input type="date" class="form-control" style="width: 150px;" name="creatTime" placeholder="起" value="<?php if (!empty($gets['creatTime'])){ echo $gets['creatTime']; } ?>"> - | ||
31 | - <input type="date" class="form-control" style="width: 150px;" name="endTime" placeholder="止" value="<?php if (!empty($gets['endTime'])){ echo $gets['endTime']; } ?>"> | 30 | + <input type="date" class="form-control" style="width: 150px;" name="productionStartDate" placeholder="起" value="<?php if (!empty($gets['productionStartDate'])){ echo $gets['productionStartDate']; } ?>"> - |
31 | + <input type="date" class="form-control" style="width: 150px;" name="productionEndDate" placeholder="止" value="<?php if (!empty($gets['productionEndDate'])){ echo $gets['productionEndDate']; } ?>"> | ||
32 | </div> | 32 | </div> |
33 | </td> | 33 | </td> |
34 | <td width="10%" class="text-right">创建时间:</td> | 34 | <td width="10%" class="text-right">创建时间:</td> |
35 | <td width="35%" class="text-left"> | 35 | <td width="35%" class="text-left"> |
36 | <div class="form-inline"> | 36 | <div class="form-inline"> |
37 | - <input type="date" class="form-control" style="width: 150px;" name="productionCreatTime" placeholder="起" value="<?php if (!empty($gets['productionCreatTime'])){ echo $gets['productionCreatTime']; } ?>"> - | ||
38 | - <input type="date" class="form-control" style="width: 150px;" name="productionEndTime" placeholder="止" value="<?php if (!empty($gets['productionEndTime'])){ echo $gets['productionEndTime']; } ?>"> | 37 | + <input type="date" class="form-control" style="width: 150px;" name="createTime" placeholder="起" value="<?php if (!empty($gets['createTime'])){ echo $gets['createTime']; } ?>"> - |
38 | + <input type="date" class="form-control" style="width: 150px;" name="endTime" placeholder="止" value="<?php if (!empty($gets['endTime'])){ echo $gets['endTime']; } ?>"> | ||
39 | + | ||
39 | </div> | 40 | </div> |
40 | </td> | 41 | </td> |
41 | </tr> | 42 | </tr> |
app-ht/modules/upgrade/views/upgrade/index.php
@@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
38 | </td> | 38 | </td> |
39 | </tr> | 39 | </tr> |
40 | <tr > | 40 | <tr > |
41 | - <td class="text-right">APP版本号</td> | 41 | + <td class="text-right">版本号</td> |
42 | <td class="text-left"> | 42 | <td class="text-left"> |
43 | <input type="text" class="form-control" name="version" placeholder="输入APP版本号" value="<?php if (!empty($gets['version'])){ echo $gets['version']; } ?>"> | 43 | <input type="text" class="form-control" name="version" placeholder="输入APP版本号" value="<?php if (!empty($gets['version'])){ echo $gets['version']; } ?>"> |
44 | </td> | 44 | </td> |
domain/production/Production.php
@@ -20,6 +20,9 @@ class Production | @@ -20,6 +20,9 @@ class Production | ||
20 | static function create($item) | 20 | static function create($item) |
21 | { | 21 | { |
22 | try { | 22 | try { |
23 | + if (isset($item["name"])) { | ||
24 | + $item["name"] = trim($item["name"]); | ||
25 | + } | ||
23 | $findProductionModel = ProductionModel::findOne(['name' => $item["name"]]); | 26 | $findProductionModel = ProductionModel::findOne(['name' => $item["name"]]); |
24 | if (!empty($findProductionModel)) { | 27 | if (!empty($findProductionModel)) { |
25 | return -1; | 28 | return -1; |