Przeglądaj źródła

提交tt站内信

lvhao 1 dzień temu
rodzic
commit
958bef0496

+ 86 - 0
core/CoreApp/controllers/Sdzxlist.php

@@ -0,0 +1,86 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+class Sdzxlist extends Start_Controller {
+	public function __construct(){
+		parent::__construct();
+		$this->load->library('session');
+		$this->load->_model('Model_sdzxlist','sdzxlist');
+	}
+
+    //定义方法的调用规则 获取URI第二段值
+    public function _remap($arg,$arg_array)
+    {
+        if($arg == 'index'){
+            $this->_index();
+        }else{
+            exit('No direct script access allowed');
+        }
+    }
+
+    private function _index(){
+        if($this->input->method() == 'post'){
+            $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+            $sqr = $this->input->post('sqr',true);
+            $sqr = trim($sqr);
+            $shop_id = $this->input->post('shop_id',true);
+            $plat_id = $this->input->post('plat_id',true);
+            $shop_ids = $this->input->post('shop_ids',true);
+            $ktime = $this->input->post('ktime',true);
+            $jtime = $this->input->post('jtime',true);
+            $ktime = strtotime($ktime);
+            $jtime = strtotime($jtime);
+
+            $where = "add_time >= ".$ktime."  and add_time  < ".$jtime." ";
+
+            if(!empty($sqr)){
+                $where .= " and sqr = ".$sqr." ";
+            }
+            if(!empty($shop_id)){
+                $where .= " and shop_id = ".$shop_id." ";
+            }else{
+                $where .= " and shop_id in (".$shop_ids.") ";
+            }
+            if(!empty($plat_id)){
+                $where .= " and plat_id = ".$plat_id." ";
+            }
+            //数据排序
+            $order_str = "id desc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+
+            //$list = $this->bhsq->find_all($where,"id,shop_id,plat_id,title,sku,sqr,sq_num,sq_status,add_time,update_time",$order_str,$start,$perpage);
+            $list = [];
+
+            if(empty($list)){
+                $rows = array('total'=>0,'over'=>1,'pagenum'=>0,'rows'=>([]));
+                echo json_encode($rows);exit;
+            }
+            $shop_list = $this->shop->find_all("1=1","id,shopname");
+            $shop_list = array_column($shop_list,'shopname','id');
+            $plat_list = $this->typeclass->find_all("classid = 32","id,title");
+            $plat_list = array_column($plat_list,'title','id');
+            $status_list = $this->bhsq->getSqStatus();
+            foreach($list as $k=>$v){
+               
+                $list[$k]['update_time'] = "";
+            }
+
+
+            $total = $this->bhsq->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+            $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($list));
+		    echo json_encode($rows);exit;
+
+        }else{
+            $this->_Template('sdzxlist_index',$this->data);
+        }
+    }
+}

+ 138 - 0
template/erp/sdzxlist_index.html

@@ -0,0 +1,138 @@
+{Template header}
+<style>
+     .diysearch{
+        padding: 5px;
+    }
+    .diysearch select{
+        width: 110px;
+        height: 28px;
+        color: #333;
+        border: 1px #ccc solid;
+        font-size: 13px;
+        margin-right: 20px;
+        border-radius: 5px;
+    }
+    .diysearch input{
+        width: 100px;
+        height: 26px;
+        color: #000;
+        border: 1px #ccc solid;
+        font-size: 13px;
+        margin-right: 20px;
+        text-align: center;
+        color: #333;
+        border-radius: 5px;
+    }
+    .diysearch .qd_show{
+        width: 70px;
+        height: 30px;
+        line-height: 30px;
+        background: #2ca8a1;
+        text-align: center;
+        color: #fff;
+        border-radius: 5px;
+        display: inline-block;
+        margin-left: 20px;
+        cursor: pointer;
+        border: 0px solid #2ca8a1;
+    }
+    .px_do{
+        width:100%;border:1px solid #ccc;text-align:center;border-radius:5px;height:100%
+    }
+</style>
+<body>
+<div class="warp">
+<div class="fixed">
+<div  style="width:100%;display: flex;flex-direction: row;flex-wrap: wrap;">
+  
+    <div class="diysearch">
+        店铺类型:
+        <select name="shop" class="select" style="width:190px">
+            <option value="">请选择</option>
+            {loop usershop() as $val}
+            <option value="{$val['id']}">{$val['shopname']}</option>
+            {/loop}</select>
+    </div>
+   
+
+    <div  class="diysearch">
+        <button onclick="searchspan(1)" class="qd_show">确 定</button>
+    </div>
+</div>
+
+<div class="control">
+<a href="javascript:void(0);" class="window" data-h="/shop/add/" data-t="店铺管理 - 添加">添 加</a>
+<a href="javascript:void(0);" class="check">删 除</a>
+</div>
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>店铺名字</td>
+<td>订单号</td>
+<td>状态</td>
+<td>错误原因</td>
+<td>记录时间</td>
+<td>操作</td>
+
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<script>
+var dataurl = "/sdzxlist/index";
+var editurl = "/sdzxlist/edit/";
+var editpx = "/sdzxlist/pxsort"
+var editdj = 3;
+var editt = "店铺管理 - 修改";
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+    $(this).find('td:eq(0)').css("width","1%");
+    $(this).find('td:eq(1)').css("width","6%");
+    $(this).find('td:eq(2)').css("width","6%");
+    $(this).find('td:eq(3)').css("width","12%");
+    $(this).find('td:eq(4)').css("width","6%");
+    $(this).find('td:eq(5)').css("width","6%");
+    $(this).find('td:eq(6)').css("width","6%");
+    $(this).find('td:eq(7)').css("width","12%");
+    $(this).find('td:eq(8)').css("width","6%");
+    $(this).find('td:eq(9)').css("width","6%");
+    $(this).find('td:eq(10)').css("width","6%");
+    $(this).find('td:eq(11)').css("width","6%");
+    $(this).find('td:eq(12)').css("width","20%");
+   
+
+// $(this).find('td:eq(11)').css("width","5%");
+});
+}
+
+
+
+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();
+        });
+           
+       
+   
+}
+$(document).ready(function(){
+   
+    searchspan(1);
+    $("select[name='perpage']").on("change",function(){
+        searchspan(1);
+    });
+   
+})
+
+</script>
+{Template footer}