xiaoyu 2 vuotta sitten
vanhempi
commit
2937fa96f8

+ 33 - 0
admin/control/retail.php

@@ -0,0 +1,33 @@
+<?php
+
+class retailControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $retail_mod = Model('retail');
+        $cond = [];
+        if(in_array($_GET['state'], [retailModel::state_init, retailModel::state_commit]) && !empty($_GET['state'])) {
+            $cond['state'] = $_GET['state'];
+        }
+        $retail_list = $retail_mod->getList($cond, 200);
+
+        Tpl::output('list', $retail_list);
+        Tpl::output('state_text', ['未提交','已提交']);
+        Tpl::output('page', $retail_mod->showpage());
+        Tpl::showpage('retail.list');
+    }
+
+    public function retail_disposeOp()
+    {
+        $retail_mod = Model('retail');
+        $id = $_GET['id'];
+        $cond['retail_id'] = ['in',$id];
+        $retail_mod->dispose_commit($cond);
+        showMessage('操作成功','index.php?act=retail&op=index');
+    }
+}

+ 4 - 2
admin/include/limit.php

@@ -2,7 +2,7 @@
 /**
  * 载入权限
  *
- 
+
  */
 defined('InShopNC') or exit('Access Invalid!');
 $_limit =  array(
@@ -55,7 +55,9 @@ $_limit =  array(
         array('name'=> '任务列表', 'op'=>null, 'act'=>'task'),
         array('name'=> '异常订单列表', 'op'=>null, 'act'=>'refill_error'),
         array('name'=> '服务器磁盘监控', 'op'=>null, 'act'=>'arw_monitor'),
-
+    )),
+    array('name' => '办卡业务', 'child' => array(
+        array('name' => '信息列表', 'op' => null, 'act' => 'retail'),
     )),
 	array('name'=>$lang['nc_store'], 'child'=>array(
 		array('name'=>$lang['nc_store_manage'], 'op'=>null, 'act'=>'store'),

+ 67 - 46
admin/include/menu.php

@@ -2,7 +2,7 @@
 /**
  * 菜单
  *
- 
+
  */
 defined('InShopNC') or exit('Access Invalid!');
 /**
@@ -11,39 +11,53 @@ defined('InShopNC') or exit('Access Invalid!');
  */
 $arr = array(
 		'top' => array(
-			0 => array(
+			[
 				'args' 	=> 'dashboard',
-				'text' 	=> $lang['nc_console']),
-			1 => array(
+				'text' 	=> $lang['nc_console']
+			],
+			[
 				'args' 	=> 'setting',
-				'text' 	=> $lang['nc_config']),
-			2 => array(
+				'text' 	=> $lang['nc_config']
+			],
+			[
 				'args' 	=> 'goods',
-				'text' 	=> $lang['nc_goods']),
-			3 => array(
+				'text' 	=> $lang['nc_goods']
+			],
+			[
 				'args' 	=> 'merchant',
-				'text' 	=> '充值业务'),
-			4 => array(
+				'text' 	=> '充值业务'
+			],
+			[
+				'args' 	=> 'card',
+				'text' 	=> '办卡业务'
+			],
+			[
 				'args' 	=> 'store',
-				'text' 	=> $lang['nc_store']),
-			5 => array(
+				'text' 	=> $lang['nc_store']
+			],
+			[
 				'args'	=> 'member',
-				'text'	=> $lang['nc_member']),
-			6 => array(
+				'text'	=> $lang['nc_member']
+			],
+			[
 				'args' 	=> 'trade',
-				'text'	=> $lang['nc_trade']),
-			7 => array(
+				'text'	=> $lang['nc_trade']
+			],
+			[
 				'args'	=> 'website',
-				'text' 	=> $lang['nc_website']),
-			8 => array(
+				'text' 	=> $lang['nc_website']
+			],
+			[
 				'args'	=> 'operation',
-				'text'	=> $lang['nc_operation']),
-			9 => array(
+				'text'	=> $lang['nc_operation']
+			],
+			[
 				'args'	=> 'stat',
-				'text'	=> $lang['nc_stat']),
+				'text'	=> $lang['nc_stat']
+			],
 		),
 		'left' =>array(
-			0 => array(
+			[
 				'nav' => 'dashboard',
 				'text' => $lang['nc_normal_handle'],
 				'list' => array(
@@ -55,8 +69,8 @@ $arr = array(
 					array('args'=>'goods,goods,dashboard',					'text'=>$lang['nc_goods_manage']),
 					array('args'=>'index,order,dashboard',			        'text'=>$lang['nc_order_manage']),
 				)
-			),
-			1 => array(
+			],
+			[
 				'nav' => 'setting',
 				'text' => $lang['nc_config'],
 				'list' => array(
@@ -76,8 +90,8 @@ $arr = array(
 					array('args'=>'search,search,setting',			'text'=>$lang['nc_admin_search_set']),
 					array('args'=>'list,admin_log,setting',			'text'=>$lang['nc_admin_log']),
 				)
-			),
-			2 => array(
+			],
+			[
 				'nav' => 'goods',
 				'text' => $lang['nc_goods'],
 				'list' => array(
@@ -88,8 +102,8 @@ $arr = array(
 					array('args'=>'spec,spec,goods',						'text'=>$lang['nc_spec_manage']),
 					array('args'=>'list,goods_album,goods',					'text'=>$lang['nc_album_manage']),
 				)
-			),
-			3 => array(
+			],
+			[
 				'nav' => 'merchant',
 				'text' => '充值业务',
 				'list' => array(
@@ -120,8 +134,15 @@ $arr = array(
 					array('args'=>'index,refill_error,merchant',			'text'=>'异常订单列表'),
 					array('args'=>'index,arw_monitor,merchant',			'text'=>'服务器磁盘监控'),
 				)
-			),
-			4 => array(
+			],
+			[
+				'nav' => 'card',
+				'text' => '办卡业务',
+				'list' => array(
+					array('args'=>'index,retail,card',			'text'=> '信息列表'),
+				)
+			],
+			[
 				'nav' => 'store',
 				'text' => $lang['nc_store'],
 				'list' => array(
@@ -134,8 +155,8 @@ $arr = array(
 					array('args'=>'edit_info,store_joinin,store',			'text'=>'开店首页'),
 					array('args'=>'list,ownshop,store',						'text'=>'自营店铺'),
 				)
-			),
-			5 => array(
+			],
+			[
 				'nav' => 'member',
 				'text' => $lang['nc_member'],
 				'list' => array(
@@ -152,8 +173,8 @@ $arr = array(
 					array('args'=>'member_tag,sns_member,member',			'text'=>$lang['nc_member_tag']),
 					array('args'=>'chat_log,chat_log,member',				'text'=>'聊天记录')
 				)
-			),
-			6 => array(
+			],
+			[
 				'nav' => 'trade',
 				'text' => $lang['nc_trade'],
 				'list' => array(
@@ -168,8 +189,8 @@ $arr = array(
 					array('args'=>'complain_new_list,complain,trade',		'text'=>$lang['nc_complain_config']),
 					array('args'=>'index,tools,trade',						'text'=>$lang['tools'])
 				)
-			),
-			7 => array(
+			],
+			[
 				'nav' => 'website',
 				'text' => $lang['nc_website'],
 				'list' => array(
@@ -182,14 +203,14 @@ $arr = array(
 					array('args'=>'rec_list,rec_position,website',			'text'=>$lang['nc_admin_res_position']),
 					array('args'=>'link,link,website',						'text'=>'友情连接'),
 				)
-			),
-			8 => array(
+			],
+			[
 				'nav' => 'operation',
 				'text' => $lang['nc_operation'],
 				'list' => array(
 					array('args'=>'setting,operation,operation',			    'text'=>$lang['nc_operation_set']),
 					array('args'=>'groupbuy_template_list,groupbuy,operation',	'text'=>$lang['nc_groupbuy_manage']),
-                    array('args'=>'index,vr_groupbuy,operation',               	'text'=>'虚拟抢购设置'),
+					array('args'=>'index,vr_groupbuy,operation',               	'text'=>'虚拟抢购设置'),
 					array('args'=>'xianshi_apply,promotion_xianshi,operation',	'text'=>$lang['nc_promotion_xianshi']),
 					array('args'=>'mansong_apply,promotion_mansong,operation',	'text'=>$lang['nc_promotion_mansong']),
 					array('args'=>'bundling_list,promotion_bundling,operation',	'text'=>$lang['nc_promotion_bundling']),
@@ -201,18 +222,18 @@ $arr = array(
 					array('args'=>'activity,activity,operation',				'text'=>$lang['nc_activity_manage']),
 					array('args'=>'pointprod,pointprod,operation',				'text'=>$lang['nc_pointprod']),
 					array('args'=>'index,mall_consult,operation',               'text'=>'平台客服'),
-                    array('args'=>'index,rechargecard,operation',               'text'=>'平台充值卡'),
-                    array('args'=>'index,delivery,operation',                   'text'=>'物流自提服务站'),
+					array('args'=>'index,rechargecard,operation',               'text'=>'平台充值卡'),
+					array('args'=>'index,delivery,operation',                   'text'=>'物流自提服务站'),
 					array('args'=>'index,oper_sms,operation',                   'text'=>$lang['oper_sms'])
 				)
-			),
-			9 => array(
+			],
+			[
 				'nav' => 'stat',
 				'text' => $lang['nc_stat'],
 				'list' => array(
-			        array('args'=>'general,stat_general,stat',			'text'=>$lang['nc_statgeneral']),
+					array('args'=>'general,stat_general,stat',			'text'=>$lang['nc_statgeneral']),
 					array('args'=>'scale,stat_industry,stat',			'text'=>$lang['nc_statindustry']),
-			        array('args'=>'newmember,stat_member,stat',			'text'=>$lang['nc_statmember']),
+					array('args'=>'newmember,stat_member,stat',			'text'=>$lang['nc_statmember']),
 					array('args'=>'newstore,stat_store,stat',			'text'=>$lang['nc_statstore']),
 					array('args'=>'income,stat_trade,stat',				'text'=>$lang['nc_stattrade']),
 					array('args'=>'pricerange,stat_goods,stat',			'text'=>$lang['nc_statgoods']),
@@ -222,7 +243,7 @@ $arr = array(
 					array('args'=>'index,stat_bonus,stat',		    	'text'=>$lang['nc_bonus_statistics']),
 					array('args'=>'index,stat_daily,stat',		    	'text'=>$lang['nc_daily_statistics']),
 				)
-			),
+			],
 		),
 );
 if(C('flea_isuse')==1){

+ 242 - 0
admin/templates/default/retail.list.php

@@ -0,0 +1,242 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+        margin-left: 10px;
+    }
+    .lineLi {
+        display: inline-block;
+        min-width: 150px;
+        font-size: 14px;
+    }
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+    .layui-form-select .layui-input {
+        height: 23px;
+        padding-left: 11px;
+        padding-right: 0 !important;
+    }
+    input::placeholder {
+        color: #333;
+    }
+    .layui-form-selected dl {
+        display: flex !important;
+        flex-wrap: wrap !important;
+    }
+    .layui-form-select dl {
+        top: 29px !important;
+        left: 4px !important;
+        min-width: 802% !important;
+        max-height: 280px !important;
+        padding: 14px 0 !important;
+    }
+    .layui-form-select dl dd.layui-this {
+        display: none;
+    }
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>信息列表</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>信息列表</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" action="index.php" name="formSearch" id="formSearch">
+        <input type="hidden" name="act" value="retail"/>
+        <input type="hidden" name="op" value="index"/>
+
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label>提交状态</label></th>
+                <td>
+
+                    <select name="state" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="<?php echo retailModel::state_init?>"
+                                <?php if ($_GET['state'] == '0'){ ?>selected<?php } ?>>未提交
+                        </option>
+                        <option value="<?php echo retailModel::state_commit?>"
+                                <?php if ($_GET['state'] == '1'){ ?>selected<?php } ?>>已提交
+                        </option>
+                    </select>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+        </table>
+
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="dispose">
+                        <span><i class="icon-edit"></i>批量标记为已提交</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <table class="table tb-type2 nobdb">
+        <thead>
+        <tr class="thead">
+            <th class="align-center" id="selectAll">
+                <input type="checkbox" name="chbox" value="">
+            </th>
+            <th class="align-left">编号</th>
+            <th class="align-left">信息编号</th>
+            <th class="align-left">渠道code</th>
+            <th class="align-left">省市区</th>
+            <th class="align-left">详细地址</th>
+            <th class="align-left">联系人</th>
+            <th class="align-left">联系电话</th>
+            <th class="align-left">身份证号码</th>
+            <th class="align-center">收集日期</th>
+            <th class="align-center">是否提交</th>
+            <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['list']) > 0) { ?>
+            <?php
+            foreach ($output['list'] as $key => $value) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center">
+                        <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $value['retail_id'];?>">
+                    </td>
+                    <td class="align-left"><?php echo $key+1;?></td>
+                    <td class="align-left"><?php echo $value['retail_sn']; ?></td>
+                    <td class="align-left"><?php echo $value['channel_code'];?></td>
+                    <td class="align-left"><?php echo "{$value['province']}-{$value['city']}-{$value['area']}"; ?></td>
+                    <td class="align-left"><?php echo $value['address']; ?></td>
+                    <td class="align-left"><?php echo $value['applicant_name']; ?></td>
+                    <td class="align-left"><?php echo $value['contact_phone']; ?></td>
+                    <td class="align-left"><?php echo $value['id_card']; ?></td>
+                    <td class="align-center"><?php echo date('Y-m-d H:i:s', $value['create_time']) ?? '/'; ?></td>
+                    <td class="align-center">
+                        <?php if ($value['state'] == '1') { ?>
+                            <span style="color: #0bb20c">
+                        <?php } ?>
+                        <?php if ($value['state'] == '0') { ?>
+                            <span style="color: #f30707">
+                        <?php } ?>
+                            <?php echo $output['state_text'][$value['state']]; ?>
+                        </span>
+                    </td>
+                    <td class="align-center">
+                        <a href="index.php?act=retail&op=retail_dispose&id=<?php echo $value['retail_id']; ?>">
+                            标记为已提交</a>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="11"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="11" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+    <!-- 预警提示 -->
+    <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript">
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+
+        //全选
+        $('#selectAll' ).click ( function () {
+            if ($("input[name='chbox']").is(':checked')) {
+                $("input[name='checkbox']").each(function() {
+                    this.checked = true;
+                })
+            } else {
+                $("input[name='checkbox']").each(function() {
+                    this.checked = false;
+                })
+            }
+        })
+
+        let get_sel_id = function (){
+            let arr = [];
+            $("input:checkbox:checked").each(function () {
+                let sel_id = $(this).val();
+                if(sel_id !== '') {
+                    arr.push(sel_id);
+                }
+            })
+            if (arr.length <= 0) { return}
+            return arr.join(",")
+        }
+
+        //批量失败
+        $('#dispose').click(function () {
+            layer.confirm('您确定要批量处理为已提交吗', {
+                btn: ['确定', '取消'],
+                title: '批量处理'
+            }, function () {
+                const batch = get_sel_id();
+                window.location.href = `index.php?act=retail&op=retail_dispose&id= ${batch ? batch : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            let data_color = $(this).attr('data-timeout_State');
+            $(this).css('background', '#fff')
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this).css('background', '#fff')
+            })
+        })
+    })
+
+</script>

+ 27 - 0
data/model/retail.model.php

@@ -0,0 +1,27 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class retailModel extends Model
+{
+    const state_init = 0;
+    const state_commit = 1;
+
+    public function __construct()
+    {
+        parent::__construct('retail');
+    }
+
+    public function getList($condition, $pagesize = '',$total = 0, $field = '*', $order = 'create_time asc', $limit = '', $master = false)
+    {
+        $list = $this->field($field)->where($condition)->page($pagesize,$total)->order($order)->limit($limit)->master($master)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
+
+    public function dispose_commit($cond)
+    {
+        $cond['state'] = self::state_init;
+        return $this->where($cond)->update(['state' => self::state_commit]);
+    }
+}