Pārlūkot izejas kodu

修改店铺的列表筛选

lvhao 1 mēnesi atpakaļ
vecāks
revīzija
3f0b979297
2 mainītis faili ar 25 papildinājumiem un 1 dzēšanām
  1. 9 1
      core/CoreApp/controllers/Shop.php
  2. 16 0
      template/erp/shop.html

+ 9 - 1
core/CoreApp/controllers/Shop.php

@@ -47,7 +47,9 @@ class Shop extends Start_Controller {
 		{
 		    $page = $this->input->post('page',true);
 		    $perpage = $this->input->post('perpage',true);
-			 $shopname = $this->input->post('shopname',true);
+			$shopname = $this->input->post('shopname',true);
+			$type = $this->input->post('type',true);
+			$status = $this->input->post('status',true);
 			$where = "1=1 ";
             //数据排序
             $order_str = "id asc";
@@ -55,6 +57,12 @@ class Shop extends Start_Controller {
             {
                 $where  .= " and shopname like '%$shopname%'";
             }
+			if(!empty($type)){
+				$where  .= " and type = ".$type." ";
+			}
+			if($status === 0 || $status == 1){
+				$where  .= " and status = ".$status." ";
+			}
             if(empty($page))
 		    {
                 $start = 0;

+ 16 - 0
template/erp/shop.html

@@ -4,6 +4,22 @@
 <div class="fixed">
 <ul class="search">
 <li>店铺名称:<input value="" name="shopname" type="text"></li>
+
+<li>店铺类型:
+    <select name="type" class="select class isshopid">
+        <option value="" >请选择</option>
+        {loop typeclass(32) as $val}
+        <option value="{$val['id']}" >{$val['title']}</option>
+        {/loop}
+        </select>
+</li>
+<li>店铺状态:
+    <select name="status" class="select class">
+        <option value="-1" >请选择</option>
+        <option value="0">active</option>
+        <option  value="1">inactive</option>
+        </select>
+</li>
 <li><span>确 定</span></li>
 </ul>
 <div class="control">