瀏覽代碼

添加店铺状态,不启用的在其他地方不展示

lvhao 5 月之前
父節點
當前提交
3df0a3689f

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

@@ -65,12 +65,13 @@ class Shop extends Start_Controller {
                 $start = ($page - 1)*$perpage;
             }
             //取得信息列表
-            $info_list = $this->shop->find_all($where,'id,type,shopname,shortname,estimaterate,mustba,shopid,yyid,tb',$order_str,$start,$perpage);
+            $info_list = $this->shop->find_all($where,'id,type,shopname,shortname,estimaterate,mustba,shopid,yyid,tb,status',$order_str,$start,$perpage);
 			 //格式化数据
             foreach ($info_list as $key=>$value) 
 		    {
 				$type = $this->typeclass->read($value['type']);
-				$info_list[$key]['type'] = $type['title'];
+				
+				$info_list[$key]['type'] = empty($type['title'])?"":$type['title'];
 				if($value['mustba'] == 1)
 				{
 					$info_list[$key]['mustba'] = '需要审核';
@@ -87,6 +88,12 @@ class Shop extends Start_Controller {
 				{
 					$info_list[$key]['tb'] = '不同步';
 				}
+
+				if($value['status'] == 0){
+					$info_list[$key]['status'] = 'active';
+				}else{
+					$info_list[$key]['status'] = 'inactive';
+				}
             }
 		    $total = $this->shop->find_count($where);
 		    $pagenum = ceil($total/$perpage);

+ 12 - 5
core/CoreApp/libraries/Common.php

@@ -47,11 +47,18 @@ $this->ci = &get_instance();
 	$this->ci->load->_model('Model_shop','shop');
     $user = $this->ci->user->get_api($_SESSION['api']);
 	$usersp = explode('|',trim($user['shop'],'|'));$sid = '';
-	foreach ($usersp as $v) 
-	{
-		$sid .= " id = ".$v." or";
-	}
-    $result = $this->ci->shop->find_all(rtrim($sid,'or'),'*',$order,0,$num);
+	// foreach ($usersp as $v) 
+	// {
+	// 	$sid .= " id = ".$v." or";
+	// }
+    // $result = $this->ci->shop->find_all(rtrim($sid,'or'),'*',$order,0,$num);
+
+	$where = " status = 0 ";
+	
+	$where .= " and id in  (".implode(",",$usersp).") ";
+	
+    $result = $this->ci->shop->find_all($where,'*',$order,0,$num);
+
     return $result;
 	}
 	/*仓库*/

+ 1 - 0
template/erp/shop.html

@@ -21,6 +21,7 @@
 <td>邮箱/ShopID</td>
 <td>用友ID</td>
 <td>是否同步</td>
+<td>店铺状态</td>
 </tr>
 </table>
 </div>

+ 8 - 2
template/erp/shop_add.html

@@ -155,7 +155,13 @@
 <em>用友ID:</em>
 <input value="" name="yyid" type="text" >
 </li>
-
+<li>
+	<em>店铺状态:</em>
+	<select name="status" class="select class">
+	<option value="0">active</option>
+	<option value="1">inactive</option>
+	</select>
+	</li>
 <li>
 <em>M2用户名:</em>
 <input value="" name="username" type="text" >
@@ -168,7 +174,7 @@
 </li>
 
 
-<li class="length">
+<li>
 <em>M2地址:</em>
 <input value="" name="m2url" type="text" >
 </li>

+ 8 - 1
template/erp/shop_edit.html

@@ -158,6 +158,13 @@
 <em>用友ID:</em>
 <input value="{$shop['yyid']}" name="yyid" type="text" >
 </li>
+<li>
+	<em>店铺状态:</em>
+	<select name="status" class="select class">
+	<option {if $shop['status'] == 0}selected="selected"{/if} value="0">active</option>
+	<option {if $shop['status'] == 1}selected="selected"{/if}  value="1">inactive</option>
+	</select>
+</li>
 
 <li>
 <em>M2用户名:</em>
@@ -171,7 +178,7 @@
 </li>
 
 
-<li class="length">
+<li>
 <em>M2地址:</em>
 <input value="{$shop['m2url']}" name="m2url" type="text" >
 </li>