Jddj.php
2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* tpshop
* ============================================================================
* 版权所有 2015-2027 深圳搜豹网络科技有限公司,并保留所有权利。
* 网站地址: http://www.tp-shop.cn
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
* 不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* Author: 当燃
* Date: 2015-09-09
*/
namespace app\manager\controller;
use think\db\Query;
use think\Page;
use think\AjaxPage;
use think\Verify;
use think\Db;
use think\Session;
use think\Cache;
use qcloudcos\Conf;
use qcloudcos\Myqcloudcos;
class Jddj extends Base
{
public $group;
/*
* 初始化操作
*/
public function __construct()
{
parent::__construct();
$this->group = include APP_PATH.'admin/conf/menuarr.php';
}
/********************************************商家模块**************************************************************/
/**
* 获取商家列表
* @return store_list
*/
public function index()
{
$model = M('jd_store');
$list = array();
$pagenum=20;//每页显示多少条
if ((int)I('pagenum/s')>0)
{
$pagenum=I('pagenum/s');
}
$keywords = I('keywords/s');
$is_audit = I('shenghe/s');
$is_ylpapp = I('is_ylpapp/s');
$qy=I('qianyi/s');
$is_usererp = I('is_usererp/s');
if ($is_usererp !=""){
if($is_usererp==1) {
$where['b.ERPId']=array('neq','');
}
else
{
$where['b.ERPId']='';
}
}
if ($keywords) {
$where['a.venderid|b.ERPId|b.store_name']=array(['like','%'.$keywords.'%']);;
}
$count = $model->alias('a')
->join('store b','a.store_id=b.store_id','left')
->where($where)->count(1);
$Page = $pager = new Page($count,$pagenum);
$list = $model->alias('a')
->join('store b','a.store_id=b.store_id','left')
->where($where)
->limit($Page->firstRow.','.$Page->listRows)->order('id asc')
->field('a.*,b.store_name,b.ERPId')
->select();
$show = $Page->show();
$this->assign('keywords',$keywords);
$this->assign('list',$list);// 赋值数据集
$this->assign('page',$show);// 赋值分页输出
$this->assign('pager',$pager);
$this->assign('pagenum',$pagenum);
$this->assign('oldurl',urlencode(curPageURL()));
return $this->fetch();
}
}