Pārlūkot izejas kodu

合并好,到货通知后台。

stanley-king 8 gadi atpakaļ
vecāks
revīzija
e9a40451ee

+ 0 - 65
admin/control/arrival_notice.php

@@ -1,65 +0,0 @@
-<?php
-
-defined('InShopNC') or exit('Access Invalid!');
-
-class arrival_noticeControl extends SystemControl
-{
-
-    public function __construct(){
-        parent::__construct();
-    }
-    static private function asc($dest, $src)
-    {
-        return $dest['count'] > $src['count'];
-    }
-
-    static private function des($dest, $src)
-    {
-        return $dest['count'] < $src['count'];
-    }
-
-    public function arrival_noticeOp()
-    {
-        $goods_name = trim($_REQUEST['goods_name']);
-        $sort = trim($_REQUEST['sort']);
-        $mod_arrival_notice = Model('arrival_notice');
-
-        $data = [];
-        if (!empty($goods_name))
-        {
-            $condition = array('goods_name'=>array('like',"%$goods_name%"),'an_type=1');
-            $result = $mod_arrival_notice->getArrivalNoticeList($condition, 'goods_id,goods_name');
-        } else {
-            $result = $mod_arrival_notice->getArrivalNoticeList(array('an_type=1'), 'goods_id,goods_name');
-        }
-
-        foreach ($result as $item => $value) {
-            $data[$value['goods_id']]['count']++;
-            if ($data[$value['goods_id']]['name'] == null)
-                $data[$value['goods_id']]['name']=$value['goods_name'];
-        }
-        if ($sort == 'descending') {
-            usort($data, "des");
-        }
-        else if ($sort == 'ascending')
-        {
-            usort($data, "asc");
-        }
-
-        $model_mb_arrival = Model('arrival_notice');
-
-        Tpl::output('list', $data);
-        Tpl::output('page', $model_mb_arrival->showpage(2));
-
-        Tpl::showpage('arrival_notice');
-        if (chksubmit())
-        {
-
-        }
-        else
-        {
-            Tpl::showpage('arrival_notice');
-        }
-    }
-
-}

+ 38 - 0
admin/control/stat_anotice.php

@@ -0,0 +1,38 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class stat_anoticeControl extends SystemControl
+{
+
+    public function __construct(){
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $goods_name = trim($_REQUEST['goods_name']);
+        $sort = trim($_REQUEST['sort']);
+
+        $cond = [];
+        if(!empty($goods_name)) {
+            $cond['goods_name'] = array('like',"%{$goods_name}%");
+        }
+
+        if($sort == 'descending') {
+            $order = 'nc_count desc';
+        }
+        elseif($sort == 'ascending') {
+            $order = 'nc_count asc';
+        }
+        else {
+            $order = '';
+        }
+
+        $mod_notice = Model('arrival_notice');
+        $result = $mod_notice->where($cond)->field('count(*) as nc_count,goods_id,goods_name')->group('goods_id')->order($order)->select();
+
+        Tpl::output('list', $result);
+        Tpl::showpage('stat.anotice.list');
+    }
+}

+ 7 - 7
admin/include/limit.php

@@ -101,16 +101,16 @@ $_limit =  array(
 		array('name'=>$lang['nc_statgoods'], 'op'=>null, 'act'=>'stat_goods'),
 		array('name'=>$lang['nc_statmarketing'], 'op'=>null, 'act'=>'stat_marketing'),
 		array('name'=>$lang['nc_stataftersale'], 	'op'=>null, 'act'=>'stat_aftersale'),
-		array('name'=>$lang['nc_arrivalnotice'], 	'op'=>null, 'act'=>'arrival_notice'),
+		array('name'=>$lang['nc_arrivalnotice'], 	'op'=>null, 'act'=>'stat_anotice'),
 		)),
 );
 if (C('flea_isuse') !== NULL){
-	$_limit[] = array('name'=>闲置, 'child'=>array(
-		array('name'=>SEO设置, 'op'=>NULL, 'act'=>'flea_index'),
-		array('name'=>分类管理, 'op'=>NULL, 'act'=>'flea_class'),
-		array('name'=>首页分类管理, 'op'=>NULL, 'act'=>'flea_class_index'),
-		array('name'=>闲置管理, 'op'=>NULL, 'act'=>'flea'),
-		array('name'=>地区管理, 'op'=>NULL, 'act'=>'flea_cs')
+	$_limit[] = array('name'=>'闲置', 'child'=>array(
+		array('name'=>'SEO设置', 'op'=>NULL, 'act'=>'flea_index'),
+		array('name'=>'分类管理', 'op'=>NULL, 'act'=>'flea_class'),
+		array('name'=>'首页分类管理', 'op'=>NULL, 'act'=>'flea_class_index'),
+		array('name'=>'闲置管理', 'op'=>NULL, 'act'=>'flea'),
+		array('name'=>'地区管理', 'op'=>NULL, 'act'=>'flea_cs')
 		));
 }
 if (C('mobile_isuse') !== NULL){

+ 10 - 10
admin/include/menu.php

@@ -144,7 +144,7 @@ $arr = array(
 					array('args'=>'ap_manage,adv,website',					'text'=>$lang['nc_adv_manage']),
 					array('args'=>'web_config,web_config,website',			'text'=>$lang['nc_web_index']),
 					array('args'=>'rec_list,rec_position,website',			'text'=>$lang['nc_admin_res_position']),
-					array('args'=>'link,link,website',			'text'=>友情连接),
+					array('args'=>'link,link,website',			'text'=>'友情连接'),
 				)
 			),
 			7 => array(
@@ -182,7 +182,7 @@ $arr = array(
 					array('args'=>'pricerange,stat_goods,stat',			'text'=>$lang['nc_statgoods']),
 					array('args'=>'promotion,stat_marketing,stat',		'text'=>$lang['nc_statmarketing']),
 					array('args'=>'refund,stat_aftersale,stat',			'text'=>$lang['nc_stataftersale']),
-					array('args'=>'mb_arrival_notice,index,stat',	'text'=>$lang['nc_arrivalnotice'])
+					array('args'=>'index,stat_anotice,stat',		    'text'=>$lang['nc_arrivalnotice'])
 				)
 			),
 		),
@@ -190,17 +190,17 @@ $arr = array(
 if(C('flea_isuse')==1){
 	$arr['top'][] = array(
 				'args'	=> 'flea',
-				'text'	=> 闲置);
+				'text'	=> '闲置');
 	$arr['left'][] = array(
 				'nav' => 'flea',
-				'text' => 闲置,
+				'text' => '闲置',
 				'list' => array(
-					0 => array('args'=>'flea_index,flea_index,flea',			'text'=>SEO设置),
-					1 => array('args'=>'flea_class,flea_class,flea',			'text'=>分类管理),
-					2 => array('args'=>'flea_class_index,flea_class_index,flea','text'=>首页分类管理),
-					3 => array('args'=>'flea,flea,flea',						'text'=>闲置管理),
-					4 => array('args'=>'flea_region,flea_region,flea',			'text'=>地区管理),
-					5 => array('args'=>'adv_manage,flea_index,flea',			'text'=>闲置幻灯),
+					0 => array('args'=>'flea_index,flea_index,flea',			'text'=>'SEO设置'),
+					1 => array('args'=>'flea_class,flea_class,flea',			'text'=>'分类管理'),
+					2 => array('args'=>'flea_class_index,flea_class_index,flea','text'=>'首页分类管理'),
+					3 => array('args'=>'flea,flea,flea',						'text'=>'闲置管理'),
+					4 => array('args'=>'flea_region,flea_region,flea',			'text'=>'地区管理'),
+					5 => array('args'=>'adv_manage,flea_index,flea',			'text'=>'闲置幻灯'),
 				)
 			);
 }

+ 0 - 87
admin/templates/default/arrival_notice.php

@@ -1,87 +0,0 @@
-<?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>
-    <!-- 帮助 -->
-    <table class="table tb-type2" id="prompt">
-        <tbody>
-        <tr class="space odd">
-            <th colspan="12" class="nobg"> <div class="title nomargin">
-                    <h5><?php echo $lang['nc_prompts'];?></h5>
-                    <span class="arrow"></span> </div>
-            </th>
-        </tr>
-        <tr>
-            <td>
-                <ul>
-                    <li>可以查询每个商品的到货通知统计</li>
-                    <li>可以通过筛选条件查询需要的商品的到货通知</li>
-                </ul>
-            </td>
-        </tr>
-        </tbody>
-    </table>
-    <form method="post" id="serch_notice" name="serch_notice">
-        <input type="hidden" name="form_submit" value="ok">
-        <table class="tb-type1 noborder search">
-            <tbody>
-                <tr>
-                    <td>
-                        <label>到货通知订阅次数:
-                            <select name="sort" id="sort">
-                                <option value="descending">从大到小</option>
-                                <option value="ascending">从小到大</option>
-                            </select>
-                        </label>
-                    </td>
-                </tr>
-                <tr>
-                    <td>
-                        <label>商品名称:<input type="text" name="special_desc"></label>
-                        <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="查询">&nbsp;</a>
-                    </td>
-                </tr>
-            </tbody>
-        </table>
-    </form>
-
-    <form method="post">
-        <table class="table tb-type2">
-            <thead>
-            <tr class="space">
-                <th colspan="15" class="nobg"><?php echo $lang['nc_list'];?></th>
-            </tr>
-            <tr class="thead">
-                <th class="w12">&nbsp;</th>
-                <th>商品ID</th>
-                <th>商品名称</th>
-                <th class="w200 align-center">到货通知订阅次数</th>
-            </tr>
-            </thead>
-            <tbody>
-                <tr>
-                    <td>&nbsp;</td>
-                    <td>1234</td>
-                    <td>相宜本草</td>
-                    <td class="align-center">12</td>
-                </tr>
-            </tbody>
-            <?php if(!empty($output['list']) && is_array($output['list'])){ ?>
-                <tfoot>
-                <tr class="tfoot">
-                    <td colspan="16"><div class="pagination"> <?php echo $output['page'];?> </div></td>
-                </tr>
-                </tfoot>
-            <?php } ?>
-        </table>
-    </form>
-</div>

+ 98 - 0
admin/templates/default/stat.anotice.list.php

@@ -0,0 +1,98 @@
+<?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=" " class="current"><span>到货通知分析</span></a ></li>
+            </ul>
+        </div>
+    </div>
+    <!— 帮助 —>
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+        <tr class="space odd">
+            <th colspan="12" class="nobg"> <div class="title nomargin">
+                    <h5><?php echo $lang['nc_prompts'];?></h5>
+                    <span class="arrow"></span> </div>
+            </th>
+        </tr>
+        <tr>
+            <td>
+                <ul>
+                    <li>可以查询每个商品的到货通知统计</li>
+                    <li>可以通过筛选条件查询需要的商品的到货通知</li>
+                </ul>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <form method="post" id="serch_notice" name="serch_notice">
+        <input type="hidden" name="form_submit" value="ok">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <td>
+                    <label>到货通知订阅次数:
+                        <select name="sort" id="sort">
+                            <option value="descending">从大到小</option>
+                            <option value="ascending">从小到大</option>
+                        </select>
+                    </label>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    <label>商品名称:<input type="text" name="goods_name"></label>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="查询">&nbsp;</a >
+                </td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <script type="text/javascript">
+        $('#ncsubmit').on('click',function(){
+            $('#serch_notice').submit();
+        })
+    </script>
+
+    <form method="post">
+        <table class="table tb-type2">
+            <thead>
+            <tr class="space">
+                <th colspan="15" class="nobg"><?php echo $lang['nc_list'];?></th>
+            </tr>
+            <tr class="thead">
+                <th class="align-center">商品ID</th>
+                <th class="align-center">商品名称</th>
+                <th class="align-center">到货通知订阅次数</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if(!empty($output['list']) && is_array($output['list'])){ ?>
+                <?php foreach($output['list'] as $item){ ?>
+                    <tr class="hover">
+                        <td class="align-center"><?php echo $item['goods_id'];?></td>
+                        <td class="align-center"><?php echo $item['goods_name'];?></td>
+                        <td class="nowrap align-center"><?php echo $item['nc_count'];?></td>
+                    </tr>
+                <?php } ?>
+            <?php }else { ?>
+                <tr class="no_data">
+                    <td colspan="16"><?php echo $lang['nc_no_record'];?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <?php if(!empty($output['list']) && is_array($output['list'])){ ?>
+                <tfoot>
+                <tr class="tfoot">
+                    <td colspan="16"><div class="pagination"> <?php echo $output['page'];?> </div></td>
+                </tr>
+                </tfoot>
+            <?php } ?>
+        </table>
+    </form>
+</div>