php 获取商品列表

 //获取我和银豆有个约惠会员折扣商品
    public static function getDouble12GooodsList($lender_id)
    {
        $scoreInfo = Page_Pc_Shop_UserScoreLogModel::getUserScoreById($lender_id);
        $user_level = $scoreInfo['data']['user_level'] ? $scoreInfo['data']['user_level'] : 1;
        $goods_model = new Data_Other_ShopgoodsModel();
        $goods_arr = array(
                    '1'=> array(856,914,735),
                    '2'=> array(910,908,902),
                    '3'=> array(892,535,776),
                    '4'=> array(915,913,839),
        );
        $goods_ids = array();
        foreach ($goods_arr as $goods_key => $goods_val) {
            $goods_ids_str = implode(',', $goods_val);
            $all_goods_list[]  = $goods_model->Fetch("SELECT id,goods_name,goods_image_path,goods_score,discount_score,goods_count FROM shop_goods WHERE id in ($goods_ids_str)"); 
        }


        foreach ($all_goods_list as $k => $ids) {
            foreach ($ids as $kk => $val) {
                $final_goods_list[$k][$kk]['id'] = $val['id'];
                $final_goods_list[$k][$kk]['goods_name'] = $val['goods_name'];
                $final_goods_list[$k][$kk]['goods_score'] = $val['goods_score'];
                $final_goods_list[$k][$kk]['goods_count'] = $val['goods_count'];
                $final_goods_list[$k][$kk]['goods_image_path'] = 'https://caiyunupload.b0.upaiyun.com/photo_uploader/goods/'.$val['goods_image_path'];
                if ($lender_id) {
                   /*  $ret = self::getLenderLoanMoneyAndDiscount($lender_id);
                    $discount = $ret['discount_count'];
                    $final_goods_list[$k][$kk]['discount']  = $discount; */
                    $final_goods_list[$k][$kk]['discount_score']  = Service_lib_Shop_GoodsExchangeModel::get_activity_discount_score($lender_id,$val['goods_score'],$user_level);
                } 
               
            }
        }
        return $final_goods_list;
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值