|
@@ -30,6 +30,10 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$this->_indexnoimg();
|
|
$this->_indexnoimg();
|
|
|
}elseif($arg == 'add'){
|
|
}elseif($arg == 'add'){
|
|
|
$this->_add();
|
|
$this->_add();
|
|
|
|
|
+ }elseif($arg == 'selectgood'){
|
|
|
|
|
+ $this->_selectgood();
|
|
|
|
|
+ }elseif($arg == 'getgoodbyids'){
|
|
|
|
|
+ $this->_getgoodbyids();
|
|
|
}else{
|
|
}else{
|
|
|
$this->_index();
|
|
$this->_index();
|
|
|
}
|
|
}
|
|
@@ -494,6 +498,9 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
|
|
$rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
|
|
|
echo json_encode($rows);exit;
|
|
echo json_encode($rows);exit;
|
|
|
}else{
|
|
}else{
|
|
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
|
|
+ $user_id = $user['id'];
|
|
|
|
|
+ $this->data['user_id'] = $user_id;
|
|
|
$this->_Template('goodimglibrary_noimg',$this->data);
|
|
$this->_Template('goodimglibrary_noimg',$this->data);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -723,4 +730,76 @@ class Goodimglibrary extends Start_Controller {
|
|
|
print_r($arg_array);
|
|
print_r($arg_array);
|
|
|
die;
|
|
die;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private function _selectgood(){
|
|
|
|
|
+ if($this->input->method() == 'post'){
|
|
|
|
|
+
|
|
|
|
|
+ $params = $this->input->post(null,true);
|
|
|
|
|
+
|
|
|
|
|
+ $this->db->select('id,features, title, sku, zh, jm');
|
|
|
|
|
+ $this->db->from('crowd_goods');
|
|
|
|
|
+ $category = $params['category'];
|
|
|
|
|
+ $this->db->like('features',$category);
|
|
|
|
|
+ if(!empty($params['color'])){
|
|
|
|
|
+ $this->db->like('features',$params['color']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['density'])){
|
|
|
|
|
+ $this->db->like('features',$params['density']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['grade'])){
|
|
|
|
|
+ $this->db->like('features',$params['grade']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['haircap'])){
|
|
|
|
|
+ $this->db->like('features',$params['haircap']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['hairnumber'])){
|
|
|
|
|
+ $this->db->like('features',$params['hairnumber']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['lacecolor'])){
|
|
|
|
|
+ $this->db->like('features',$params['lacecolor']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['lacetype'])){
|
|
|
|
|
+ $this->db->like('features',$params['lacetype']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['lowe'])){
|
|
|
|
|
+ $this->db->like('features',$params['lowe']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['size'])){
|
|
|
|
|
+ $this->db->like('features',$params['size']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['zh'])){
|
|
|
|
|
+ $this->db->like('zh',$params['zh']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->db->order_by('id', 'asc');
|
|
|
|
|
+ // 分页 (limit, offset)
|
|
|
|
|
+ $this->db->limit(20, 0);
|
|
|
|
|
+
|
|
|
|
|
+ $query = $this->db->get();
|
|
|
|
|
+
|
|
|
|
|
+ $list = $query->result_array();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(empty($list)){
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'查询失败']);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>true,'msg'=>'查询成功','data'=>$list]);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->_Template('goodimglibrary_selectgood',$this->data);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ private function _getgoodbyids(){
|
|
|
|
|
+ if($this->input->method() == 'post'){
|
|
|
|
|
+ $ids = $this->input->post('ids',true);
|
|
|
|
|
+ $this->db->select('id,features, title, sku, zh, jm');
|
|
|
|
|
+ $this->db->from('crowd_goods');
|
|
|
|
|
+ $this->db->where_in('id',$ids);
|
|
|
|
|
+ $query = $this->db->get();
|
|
|
|
|
+ $list = $query->result_array();
|
|
|
|
|
+ echo json_encode(['success'=>true,'msg'=>'查询成功','data'=>$list]);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'查询失败']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|