|
@@ -25,11 +25,11 @@ class ClassifyController extends WeChatBaseController{ |
|
@@ -25,11 +25,11 @@ class ClassifyController extends WeChatBaseController{ |
25
|
$classify_id = $this -> request -> param();
|
25
|
$classify_id = $this -> request -> param();
|
26
|
if($classify_id){
|
26
|
if($classify_id){
|
27
|
//获取指定分类商品
|
27
|
//获取指定分类商品
|
28
|
- $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();
|
28
|
+ $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.is_out = 1 and a.classify_id =".$classify_id['classify_id']) -> select() -> toArray();
|
29
|
$this -> assign('class',$classify_id['classify_id']);
|
29
|
$this -> assign('class',$classify_id['classify_id']);
|
30
|
}else{
|
30
|
}else{
|
31
|
//获取默认分类商品
|
31
|
//获取默认分类商品
|
32
|
- $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();
|
32
|
+ $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.is_out = 1 and a.classify_id =".$data_classify[0]['id']) -> select() -> toArray();
|
33
|
$this -> assign('class',$data_classify[0]['id']);
|
33
|
$this -> assign('class',$data_classify[0]['id']);
|
34
|
}
|
34
|
}
|
35
|
foreach($data_goods as $key => $val){
|
35
|
foreach($data_goods as $key => $val){
|
|
@@ -50,7 +50,7 @@ class ClassifyController extends WeChatBaseController{ |
|
@@ -50,7 +50,7 @@ class ClassifyController extends WeChatBaseController{ |
50
|
public function classify_goods(){
|
50
|
public function classify_goods(){
|
51
|
|
51
|
|
52
|
$classify_id = $_POST['classify_id'];
|
52
|
$classify_id = $_POST['classify_id'];
|
53
|
- $data_classify_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) -> select() -> toArray();
|
53
|
+ $data_classify_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.is_out = 1 and a.classify_id =".$classify_id) -> select() -> toArray();
|
54
|
foreach($data_classify_goods as $key => $val){
|
54
|
foreach($data_classify_goods as $key => $val){
|
55
|
$price = explode('.',$data_classify_goods[$key]['price']);
|
55
|
$price = explode('.',$data_classify_goods[$key]['price']);
|
56
|
$data_classify_goods[$key]['price0'] = $price[0];
|
56
|
$data_classify_goods[$key]['price0'] = $price[0];
|
|
@@ -68,7 +68,7 @@ class ClassifyController extends WeChatBaseController{ |
|
@@ -68,7 +68,7 @@ class ClassifyController extends WeChatBaseController{ |
68
|
|
68
|
|
69
|
$label_id = $_POST['label_id'];
|
69
|
$label_id = $_POST['label_id'];
|
70
|
$classify_id = $_POST['classify_id'];
|
70
|
$classify_id = $_POST['classify_id'];
|
71
|
- $data_classify_lable_goods = Db::name('goods') -> alias('a') -> field("a.*") -> join('goods_label b','a.id = b.goods_id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id." and b.label_id =".$label_id) -> select() -> toArray();
|
71
|
+ $data_classify_lable_goods = Db::name('goods') -> alias('a') -> field("a.*") -> join('goods_label b','a.id = b.goods_id','LEFT') -> where("a.type = 1 and a.is_out = 1 and a.classify_id =".$classify_id." and b.label_id =".$label_id) -> select() -> toArray();
|
72
|
$data_classify_name = Db::name('classification') -> where('id',$classify_id) -> find();
|
72
|
$data_classify_name = Db::name('classification') -> where('id',$classify_id) -> find();
|
73
|
foreach($data_classify_lable_goods as $key => $val){
|
73
|
foreach($data_classify_lable_goods as $key => $val){
|
74
|
$price = explode('.',$data_classify_lable_goods[$key]['price']);
|
74
|
$price = explode('.',$data_classify_lable_goods[$key]['price']);
|
|
@@ -87,7 +87,8 @@ class ClassifyController extends WeChatBaseController{ |
|
@@ -87,7 +87,8 @@ class ClassifyController extends WeChatBaseController{ |
87
|
public function classify_sales(){
|
87
|
public function classify_sales(){
|
88
|
|
88
|
|
89
|
$where = [
|
89
|
$where = [
|
90
|
- 'a.type' => 1
|
90
|
+ 'a.type' => 1,
|
|
|
91
|
+ 'a.is_out' => 1
|
91
|
];
|
92
|
];
|
92
|
if(!empty($_POST['classify_id'])){
|
93
|
if(!empty($_POST['classify_id'])){
|
93
|
$where['a.classify_id'] = $_POST['classify_id'];
|
94
|
$where['a.classify_id'] = $_POST['classify_id'];
|
|
@@ -114,7 +115,8 @@ class ClassifyController extends WeChatBaseController{ |
|
@@ -114,7 +115,8 @@ class ClassifyController extends WeChatBaseController{ |
114
|
public function classify_price(){
|
115
|
public function classify_price(){
|
115
|
|
116
|
|
116
|
$where = [
|
117
|
$where = [
|
117
|
- 'a.type' => 1
|
118
|
+ 'a.type' => 1,
|
|
|
119
|
+ 'a.is_out' => 1
|
118
|
];
|
120
|
];
|
119
|
if(!empty($_POST['classify_id'])){
|
121
|
if(!empty($_POST['classify_id'])){
|
120
|
$where['classify_id'] = $_POST['classify_id'];
|
122
|
$where['classify_id'] = $_POST['classify_id'];
|