1234567891011121314151617181920212223242526272829303132333435363738 |
- <?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');
- }
- }
|