Procházet zdrojové kódy

完成清除缓存

lvhao před 14 hodinami
rodič
revize
37dbe6e9d7

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

@@ -39,6 +39,9 @@ class Typeclass extends Start_Controller {
         {
              $this->_excel();
         }
+		else if($arg == 'qchcl'){
+			 $this->_qchcl();
+		}
 		else
 		{
 			 $this->_index($arg_array);
@@ -164,6 +167,19 @@ class Typeclass extends Start_Controller {
 		$this->data['class'] = $class;
 		$this->_Template('typeclass_cx',$this->data);
 	}
+
+	public function _qchcl(){
+		if($this->input->method(TRUE) === "GET"){
+			$this->load->driver('cache');
+			$this->cache->delete('choice_page_1');
+			$this->cache->delete('choices_page_1');
+			$this->cache->delete('choice_page_2');
+			$this->cache->delete('choices_page_2');
+			echo json_encode(["msg"=>"清除缓存成功",'success'=>true]);
+		}else{
+			echo json_encode(["msg"=>"请求方式不对",'success'=>false]);
+		}
+	}
 	
 	
 	//添加

+ 21 - 0
template/erp/typeclass.html

@@ -24,6 +24,7 @@
 <a href="javascript:void(0);" class="check">删 除</a>
 <a href="javascript:void(0);" data-url="excel" data-id="3" class="whlabelexcel">导出条件检索数据</a>
 <a href="javascript:void(0);" class="tphq">批量操作独立站可获取数据</a>
+<a href="javascript:void(0);" class="qchcl">清除订单详情商品编辑页缓存</a>
 </div>
 <table class="datatitle data" border="0" style="border-collapse:collapse;">
 <tr>
@@ -122,5 +123,25 @@ $(".cztphq").click(function() {
 $(".esc").click(function() {
 	$(".systemwindow").hide();
 });
+$(".qchcl").click(function() {
+	$.ajax({
+		url: dataurl+"/qchcl",
+		type: "GET",
+		dataType: "json",
+		success: function(c) {
+			if (c && c.success) {
+				$(".ts p").html(c.msg);
+				$(".ts").fadeIn();
+				setTimeout('$(".ts").fadeOut()', 900);
+				return false;
+			} else {
+				$(".ts p").html(c.msg);
+				$(".ts").fadeIn();
+				setTimeout('$(".ts").fadeOut()', 900);
+				return false;
+			}
+		}
+	});
+});
 </script>
 {Template footer}