|
|
@@ -315,29 +315,30 @@ class QcodeController extends AddonController{
|
|
|
$session_config=I('session.ly_admin_');
|
|
|
$keyword = I('keyword', '', 'string');
|
|
|
$condition = array('like', '%' . $keyword . '%');
|
|
|
- $map['product_name|product_code'] = array(//查询条件数组
|
|
|
- $condition,
|
|
|
- $condition,
|
|
|
- '_multi' => true,
|
|
|
- );
|
|
|
+ if ($keyword != '' && !empty($keyword)){
|
|
|
+ $map['product_name|product_code'] = array(//查询条件数组
|
|
|
+ $condition,
|
|
|
+ $condition,
|
|
|
+ '_multi' => true,
|
|
|
+ );
|
|
|
+ }
|
|
|
$classification = I('classification', '', 'string');
|
|
|
if ($classification != '03'){
|
|
|
- $map['product_code'] = array('like','%'.$classification.'%');
|
|
|
+ $map['temple'] = substr($classification,2,2);
|
|
|
}
|
|
|
-
|
|
|
$uid = $session_config['user_auth']['uid'];
|
|
|
$user = M('admin_user');
|
|
|
$user_product = $user->where('id='.$uid)->field('product_id')->find();
|
|
|
$user_product = explode(',',$user_product['product_id']);
|
|
|
- $map['id'] = array('not in',$user_product);
|
|
|
$map['id'] = array('gt',27);
|
|
|
+
|
|
|
$p = !empty($_GET["p"]) ? $_GET['p'] : 1;
|
|
|
$product_object = D('qcode_product');
|
|
|
$count = $product_object->where($map)->count();// 查询满足要求的总记录数
|
|
|
- $Page = new \Think\Page($count,25);// 实例化分页类 传入总记录数和每页显示的记录数
|
|
|
+ $Page = new \Think\Page($count,10);// 实例化分页类 传入总记录数和每页显示的记录数
|
|
|
$show = $Page->show();// 分页显示输出
|
|
|
$data_list= $product_object->page($p.',10')->where($map)->order('id asc')->select();//所有未选中产品列表
|
|
|
-
|
|
|
+// print_r($data_list);die;
|
|
|
//辅料存货分类
|
|
|
$qcode_classification = M('qcode_classification');
|
|
|
$product_classification = $qcode_classification->where('status=1')->order('id asc')->select();
|