...
|
...
|
@@ -24,13 +24,12 @@ class ClassifyController extends WeChatBaseController{ |
|
|
$data_label = Db::name('label') -> select();
|
|
|
$classify_id = $this -> request -> param();
|
|
|
if($classify_id){
|
|
|
echo '有';
|
|
|
//获取指定分类商品
|
|
|
$data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id['classify_id']) -> select() -> toArray();
|
|
|
}else{
|
|
|
echo '没有';
|
|
|
//获取默认分类商品
|
|
|
$data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$data_classify[0]['id']) -> select() -> toArray();
|
|
|
}
|
|
|
die;
|
|
|
//获取默认分类商品
|
|
|
$data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$data_classify[0]['id']) -> select() -> toArray();
|
|
|
foreach($data_goods as $key => $val){
|
|
|
$price = explode('.',$data_goods[$key]['price']);
|
|
|
$data_goods[$key]['price0'] = $price[0];
|
...
|
...
|
|