作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

order

@@ -30,15 +30,31 @@ use EasyWeChat\Payment\Order; @@ -30,15 +30,31 @@ use EasyWeChat\Payment\Order;
30 class AdminOrderController extends AdminBaseController{ 30 class AdminOrderController extends AdminBaseController{
31 31
32 public function index(){ 32 public function index(){
  33 + $where=array();
  34 + if (!empty($param['order_no'])){
  35 + $where['order_no']=['like','%'.$param['order_no'].'%'];
  36 + }
  37 + if (!empty($param['hospital'])){
  38 + $where['hospital']=$param['hospital'];
  39 + }
  40 +
  41 + if (!empty($param['start_number'])&&!empty($param['end_number'])){
  42 + $where['serial_number']=['between',[$param['start_number'],$param['end_number']]];
  43 + }
33 $Order=new OrderModel(); 44 $Order=new OrderModel();
34 $data=$Order->alias('a') 45 $data=$Order->alias('a')
35 ->field('a.*,b.serial_number,b.hospital') 46 ->field('a.*,b.serial_number,b.hospital')
36 ->join('equipment b','a.mac_address=b.mac_address') 47 ->join('equipment b','a.mac_address=b.mac_address')
  48 + ->where($where)
37 ->paginate(10)->each(function ($item){ 49 ->paginate(10)->each(function ($item){
38 $item['time']=($item['end_time']-$item['start_time'])/3600; 50 $item['time']=($item['end_time']-$item['start_time'])/3600;
39 return $item; 51 return $item;
40 }); 52 });
41 $this->assign('data',$data); 53 $this->assign('data',$data);
  54 + $this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
  55 + $this->assign('order_no', isset($param['order_no']) ? $param['order_no'] : '');
  56 + $this->assign('start_number', isset($param['start_number']) ? $param['start_number'] : '');
  57 + $this->assign('end_number', isset($param['end_number']) ? $param['end_number'] : '');
42 return $this->fetch(); 58 return $this->fetch();
43 } 59 }
44 } 60 }
@@ -13,9 +13,6 @@ @@ -13,9 +13,6 @@
13 所属医院: 13 所属医院:
14 <input type="text" class="form-control" name="hospital" style="width: 200px;" 14 <input type="text" class="form-control" name="hospital" style="width: 200px;"
15 value="{$hospital|default=''}" placeholder="请输入关键字..."> 15 value="{$hospital|default=''}" placeholder="请输入关键字...">
16 - 备注:  
17 - <input type="text" class="form-control" name="note" style="width: 200px;"  
18 - value="{$note|default=''}" placeholder="请输入关键字...">  
19 设备编号: 16 设备编号:
20 <input type="text" class="form-control" name="start_number" 17 <input type="text" class="form-control" name="start_number"
21 value="{$start_number|default=''}" 18 value="{$start_number|default=''}"
@@ -27,11 +24,6 @@ @@ -27,11 +24,6 @@
27 <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a> 24 <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a>
28 </form> 25 </form>
29 <form class="js-ajax-form" action="" method="post"> 26 <form class="js-ajax-form" action="" method="post">
30 - <div class="table-actions">  
31 - <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"  
32 - data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">批量新增  
33 - </button>  
34 - </div>  
35 <table class="table table-hover table-bordered table-list"> 27 <table class="table table-hover table-bordered table-list">
36 <thead> 28 <thead>
37 <tr> 29 <tr>
@@ -58,41 +50,6 @@ @@ -58,41 +50,6 @@
58 </tr> 50 </tr>
59 </foreach> 51 </foreach>
60 </table> 52 </table>
61 - <!--<div class="table-actions">-->  
62 - <!--<notempty name="category">-->  
63 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
64 - <!--data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}-->  
65 - <!--</button>-->  
66 - <!--</notempty>-->  
67 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
68 - <!--data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布-->  
69 - <!--</button>-->  
70 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
71 - <!--data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布-->  
72 - <!--</button>-->  
73 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
74 - <!--data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶-->  
75 - <!--</button>-->  
76 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
77 - <!--data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶-->  
78 - <!--</button>-->  
79 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
80 - <!--data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐-->  
81 - <!--</button>-->  
82 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
83 - <!--data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐-->  
84 - <!--</button>-->  
85 - <!--&lt;!&ndash;-->  
86 - <!--<notempty name="category">-->  
87 - <!--<button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>-->  
88 - <!--</notempty>-->  
89 - <!--<button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>-->  
90 - <!--&ndash;&gt;-->  
91 - <!--<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"-->  
92 - <!--data-action="{:url('AdminArticle/delete')}" data-subcheck="true" data-msg="您确定删除吗?">-->  
93 - <!--{:lang('DELETE')}-->  
94 - <!--</button>-->  
95 - <!--</div>-->  
96 <ul class="pagination">{$page|default=''}</ul> 53 <ul class="pagination">{$page|default=''}</ul>
97 </form> 54 </form>
98 </div> 55 </div>