Commit 907c39d8c9043cb1d23ca053ad8b28ba05310b9d

Authored by xu
1 parent 701576b7
Exists in master

app-ht

1. F  调整上传日期的筛选条件
app-ht/modules/device/views/device/delete-index.php
... ... @@ -82,6 +82,7 @@ $this->params['breadcrumbs'][] = $this->title;
82 82 </div>
83 83 <div class="form-group col-sm-12" style="text-align: center;">
84 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"])?>">重&nbsp;&nbsp;&nbsp;&nbsp;置</a>
85 86 </div>
86 87 </form>
87 88 </div>
... ...
app-ht/modules/device/views/device/index.php
... ... @@ -83,6 +83,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
83 83  
84 84 <div class="form-group col-sm-12" style="text-align: center;">
85 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"])?>">重&nbsp;&nbsp;&nbsp;&nbsp;置</a>
86 87 <a class="btn btn-default" href="javascript:void(0)" id="btn-export"> 导出数据 </a>
87 88 </div>
88 89 </form>
... ...
app-ht/modules/production/controllers/ProductionController.php
... ... @@ -33,34 +33,32 @@ class ProductionController extends BaseController
33 33 protected function dataList($type = '')
34 34 {
35 35 $request = Yii::$app->request;
36   - $creatTime = $request->get('creatTime');
  36 + $createTime = $request->get('createTime');
37 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 41 $gets = [
42   - 'creatTime' => $creatTime,
  42 + 'createTime' => $createTime,
43 43 'endTime' => $endTime,
44   - 'productionCreatTime' => $productionCreatTime,
45   - 'productionEndTime' => $productionEndTime,
  44 + 'productionStartDate' => $productionStartDate,
  45 + 'productionEndDate' => $productionEndDate,
46 46 ];
47 47  
48 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 53 if ($endTime) {
54 54 $endTime = strtotime($endTime) + 86400;
55 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 63 if ($type == 0) {
66 64 $pageList = ProductionRepository::getPageList($where, 0 , 0);
... ... @@ -97,7 +95,7 @@ class ProductionController extends BaseController
97 95 public function actionDoAdd()
98 96 {
99 97 $request = Yii::$app->request;
100   - $name = $request->post("name"); // 生产日期
  98 + $name = trim($request->post("name")); // 生产日期
101 99 if (empty($name)) {
102 100 Yii::$app->session->setFlash('error', '生产日期不能为空');
103 101 return $this->render('create');
... ...
app-ht/modules/production/views/production/create.php
... ... @@ -17,7 +17,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
17 17 <div class="form-group col-sm-12">
18 18 <label for="skillName" class="col-sm-4 control-label text-right">生产日期:</label>
19 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 21 </div>
22 22 </div>
23 23 </div>
... ...
app-ht/modules/production/views/production/edit.php
... ... @@ -18,9 +18,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
18 18 <h3>编辑生产日期</h3>
19 19 </div>
20 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 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 24 </div>
25 25 </div>
26 26 </div>
... ...
app-ht/modules/production/views/production/index.php
... ... @@ -27,15 +27,16 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
27 27 <td width="10%" class="text-right">生产日期:</td>
28 28 <td width="35%" class="text-left">
29 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 32 </div>
33 33 </td>
34 34 <td width="10%" class="text-right">创建时间:</td>
35 35 <td width="35%" class="text-left">
36 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 40 </div>
40 41 </td>
41 42 </tr>
... ...
app-ht/modules/upgrade/views/upgrade/index.php
... ... @@ -38,7 +38,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
38 38 </td>
39 39 </tr>
40 40 <tr >
41   - <td class="text-right">APP版本号</td>
  41 + <td class="text-right">版本号</td>
42 42 <td class="text-left">
43 43 <input type="text" class="form-control" name="version" placeholder="输入APP版本号" value="<?php if (!empty($gets['version'])){ echo $gets['version']; } ?>">
44 44 </td>
... ...
domain/production/Production.php
... ... @@ -20,6 +20,9 @@ class Production
20 20 static function create($item)
21 21 {
22 22 try {
  23 + if (isset($item["name"])) {
  24 + $item["name"] = trim($item["name"]);
  25 + }
23 26 $findProductionModel = ProductionModel::findOne(['name' => $item["name"]]);
24 27 if (!empty($findProductionModel)) {
25 28 return -1;
... ...