orderRaw('rand()');
    /**
     * 随机获取一条商品信息
     * @param [type] $condition
     * @param [type] $field
     * @param [type] $limit
     * @return void
     */
    public function randSkuid($condition, $field, $limit)
    {
        $result = $this->where($condition)->field($field)->orderRaw('rand()')->limit($limit)->select();
        return $result ? $result->toArray() : [];
    }

 

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-12-09
  • 2021-11-28
  • 2021-07-29
  • 2022-02-17
相关资源
相似解决方案