| 
														
															@@ -100,7 +100,7 @@ module.exports = class ProductCategoryController extends shopController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const data = await that.ctx.validate(that.categoryValidate, await that.ctx.getParse()); 
														 | 
														
														 | 
														
															       const data = await that.ctx.validate(that.categoryValidate, await that.ctx.getParse()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const options = { 
														 | 
														
														 | 
														
															       const options = { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         where: { category_id: data.category_id, is_sale: 1 }, 
														 | 
														
														 | 
														
															         where: { category_id: data.category_id, is_sale: 1 }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        order: [[ 'is_hot', 'desc' ], [ 'is_new', 'desc' ]], // , [ 'product_stock', 'desc' ], [ 'product_id', 'asc' ] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        order: [[ 'is_hot', 'desc' ], [ 'is_new', 'desc' ], [ 'sale_count', 'desc' ]], // , [ 'product_stock', 'desc' ] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         // offset: (data.page - 1) * data.limit, limit: data.limit, 
														 | 
														
														 | 
														
															         // offset: (data.page - 1) * data.limit, limit: data.limit, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         attributes: [ 'product_id', 'category_id', 'product_name', 'product_image', 'shop_price', 'market_price', 'is_new', 'is_hot' ], 
														 | 
														
														 | 
														
															         attributes: [ 'product_id', 'category_id', 'product_name', 'product_image', 'shop_price', 'market_price', 'is_new', 'is_hot' ], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       }; 
														 | 
														
														 | 
														
															       }; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -108,7 +108,13 @@ module.exports = class ProductCategoryController extends shopController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       if (data.sale_sort) options.order.push([ 'sale_count', data.sale_sort == 1 ? 'asc' : 'desc' ]); 
														 | 
														
														 | 
														
															       if (data.sale_sort) options.order.push([ 'sale_count', data.sale_sort == 1 ? 'asc' : 'desc' ]); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const selectBean = await that.app.comoBean.instance(data, options); 
														 | 
														
														 | 
														
															       const selectBean = await that.app.comoBean.instance(data, options); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const result = await that.service.manager.select(selectBean, that.app.model.Products, '商品列表查看失败,请重试', true, true); 
														 | 
														
														 | 
														
															       const result = await that.service.manager.select(selectBean, that.app.model.Products, '商品列表查看失败,请重试', true, true); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      return that.ctx.appJson(that.app.szjcomo.appResult('SUCCESS', result, false)); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      // 2023/10/18  查询家具父级ID pid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      const categoryResult = await that.app.model.ProductCategory.findOne({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        where: { category_id: data.category_id }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      const jsonResult = JSON.parse(JSON.stringify(result)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      jsonResult.pid = categoryResult.pid; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      return that.ctx.appJson(that.app.szjcomo.appResult('SUCCESS', jsonResult, false)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } catch (err) { 
														 | 
														
														 | 
														
															     } catch (err) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       return that.ctx.appJson(that.app.szjcomo.appResult(err.message)); 
														 | 
														
														 | 
														
															       return that.ctx.appJson(that.app.szjcomo.appResult(err.message)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 |