...
|
...
|
@@ -76,7 +76,23 @@ class ClassifyController extends WeChatBaseController{ |
|
|
*/
|
|
|
public function classify_sales(){
|
|
|
|
|
|
dump($_POST);die;
|
|
|
$where = [
|
|
|
'a.type' => 1
|
|
|
];
|
|
|
if(!empty($_POST['classify_id'])){
|
|
|
$where['classify_id'] = $_POST['classify_id'];
|
|
|
}
|
|
|
if(!empty($_POST['lable_id'])){
|
|
|
$where['label_id'] = $_POST['lable_id'];
|
|
|
}
|
|
|
$data = Db::name('goods') -> alias('a') -> join('classification b','a.classify_id = b.id','LEFT') -> where($where) -> order('a.sales desc') -> select() -> toArray();
|
|
|
foreach($data as $key => $val){
|
|
|
$price = explode('.',$data[$key]['price']);
|
|
|
$data[$key]['price0'] = $price[0];
|
|
|
$data[$key]['price01'] = $price[1];
|
|
|
$data[$key]['show_img'] = cmf_get_image_url($data[$key]['show_img']);
|
|
|
}
|
|
|
return json_encode($data);
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -88,4 +104,13 @@ class ClassifyController extends WeChatBaseController{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|