lvhao 1 týždeň pred
rodič
commit
b9d5d30ac6
2 zmenil súbory, kde vykonal 38 pridanie a 0 odobranie
  1. 16 0
      core/CoreApp/controllers/Shop.php
  2. 22 0
      template/erp/shop.html

+ 16 - 0
core/CoreApp/controllers/Shop.php

@@ -28,6 +28,10 @@ class Shop extends Start_Controller {
 		else if($arg == 'rows')//修改
         {
              $this->_rows();
+        }
+		else if($arg == 'pxsort')//修改
+        {
+             $this->_pxsort();
         }
 		else if($arg == 'code')//修改
         {
@@ -39,6 +43,17 @@ class Shop extends Start_Controller {
 		}
     }
 
+	public function _pxsort(){
+		$user = $this->user->get_api($_SESSION['api']);
+		if(empty($user)){
+			die;
+		}
+		$id = $this->input->post('id', TRUE);
+		$px = $this->input->post('px', TRUE);
+		$this->shop->save(array('px'=>$px),$id);
+		echo json_encode(array('code'=>0,'msg'=>'修改成功'));exit;
+	}
+
 	//管理
 	public function _index()
 	{
@@ -103,6 +118,7 @@ class Shop extends Start_Controller {
 				}else{
 					$info_list[$key]['status'] = 'inactive';
 				}
+				$info_list[$key]['px'] = "<input value=".$value['px']." onchange='edit_px(this)' data-id= '".$value['id']."' class='px_do' />";
             }
 		    $total = $this->shop->find_count($where);
 		    $pagenum = ceil($total/$perpage);

+ 22 - 0
template/erp/shop.html

@@ -1,4 +1,9 @@
 {Template header}
+<style>
+    .px_do{
+        width:100%;border:1px solid #ccc;text-align:center;border-radius:5px;height:100%
+    }
+</style>
 <body>
 <div class="warp">
 <div class="fixed">
@@ -51,6 +56,7 @@
 <script>
 var dataurl = "/shop";
 var editurl = "/shop/edit/";
+var editpx = "/shop/pxsort"
 var editdj = 2;
 var editt = "店铺管理 - 修改";
 var customon = 1;
@@ -74,5 +80,21 @@ $(".data tr").each(function() {
 });
 }
 
+
+
+function edit_px(that){
+   
+        // 这里写你的代码,例如提交表单或执行其他操作
+        var id = $(that).attr("data-id");
+
+        var val = $(that).val();
+        val = val*1
+        $.post(editpx, {id: id, px: val}, function(data){
+            $(".search span").click();
+        });
+           
+       
+   
+}
 </script>
 {Template footer}