终极提交~

This commit is contained in:
2019-10-27 20:15:29 +08:00
parent df11660e6a
commit 4131f1ac50
17 changed files with 588 additions and 118 deletions

View File

@ -451,11 +451,14 @@ class Shops extends Base{
/**
* 获取店铺首页商品列表
*/
public function getShopIndexGoodsList($shopId=0,$field='*',$order='goodsId DESC'){
public function getShopIndexGoodsList($shopId=0,$field='*',$order='goodsId DESC', $from=0){
$shopId = empty($shopId) ? (int)input('post.shopId') : $shopId;
$from = empty($from) ? (int)input('post.from_id', 0) : $from;
$m = new TM();
$m->setTable('goods');
$rs = $m->getSelect(['shopId'=>$shopId,'isSale'=>1,'goodsStatus'=>1,'dataFlag'=>1],$field,$order);
$where = ['shopId'=>$shopId,'isSale'=>1,'goodsStatus'=>1,'dataFlag'=>1];
if($from==3){$where['discountRate'] = [">=", dataConf('discountRateGtToHelpShopping')];}
$rs = $m->getSelect($where,$field,$order);
foreach ($rs['Rows'] as &$v) {
$v['goodsImg'] = WSTImg($v['goodsImg'],3);
}