<?php


namespace app\lumaapi\service;


use think\Db;

class VideoService
{
    /*
        *随机产品
        */
    public static function randomGoods(){
        $timerand = mt_rand( 0,15);
        $list=[];
        if($timerand==15){
            $count= Db::connect('db_con2')->name('spell_group')->where(['status'=>1,'goods_status'=>2])->count();
            $rand = mt_rand( 0, $count-1 );
            $limit = $rand.',1';
            $list =Db::connect('db_con2')->name('spell_group')->field("group_id,num,goods_id,goods_title,original_price,group_price,group_detail")->where(['status'=>1,'goods_status'=>2])->limit( $limit )->select();
        }
        return $list;
    }
}