|
@@ -34,6 +34,8 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$this->_selectgood();
|
|
$this->_selectgood();
|
|
|
}elseif($arg == 'getgoodbyids'){
|
|
}elseif($arg == 'getgoodbyids'){
|
|
|
$this->_getgoodbyids();
|
|
$this->_getgoodbyids();
|
|
|
|
|
+ }elseif($arg == 'excelgood'){
|
|
|
|
|
+ $this->_excelgood();
|
|
|
}else{
|
|
}else{
|
|
|
$this->_index();
|
|
$this->_index();
|
|
|
}
|
|
}
|
|
@@ -803,4 +805,66 @@ class Goodimglibrary extends Start_Controller {
|
|
|
echo json_encode(['success'=>false,'msg'=>'查询失败']);exit;
|
|
echo json_encode(['success'=>false,'msg'=>'查询失败']);exit;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ private function _excelgood(){
|
|
|
|
|
+ if($this->input->method() == 'post'){
|
|
|
|
|
+ $params = $this->input->post(null,true);
|
|
|
|
|
+ $this->db->select('features, title, sku, zh, jm');
|
|
|
|
|
+ $this->db->from('crowd_goods');
|
|
|
|
|
+ if(!empty($params['category'])){
|
|
|
|
|
+ $this->db->like('features',$params['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['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']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['sku'])){
|
|
|
|
|
+ $this->db->like('sku',$params['sku']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($params['title'])){
|
|
|
|
|
+ $this->db->like('title',$params['title']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $query = $this->db->get();
|
|
|
|
|
+ $list = $query->result_array();
|
|
|
|
|
+ if(empty($list)){
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'没有数据']);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $final_list = [];
|
|
|
|
|
+ foreach($list as $k => $v){
|
|
|
|
|
+ $final_list[] = [
|
|
|
|
|
+ 'u9料号'=>$v['jm'],
|
|
|
|
|
+ '仓库品名'=>$v['zh'],
|
|
|
|
|
+ '英文名字'=>$v['title'],
|
|
|
|
|
+ 'SKU'=>$v['sku'],
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ echo json_encode(['success'=>true,'msg'=>'查询成功','data'=>$final_list]);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'请求不合法']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|