定制 hatajoe/easy-lottery 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hatajoe/easy-lottery

Composer 安装命令:

composer require hatajoe/easy-lottery

包简介

simple lottery module for PHP

关键字:

README 文档

README

A lottery class for Laravel

Installation

Install using composer:

composer require hatajoe/easy-lottery

Add the service provider in app/config/app.php:

'hatajoe\EasyLottery\EasyLotteryServiceProvider',

And add the EasyLottery alias to app/config/app.php:

'EasyLottery'            => 'hatajoe\EasyLottery\Facades\EasyLottery',

Basic Usage

<?php

$elems = [
    (object)['rate' => 10],
    (object)['rate' => 990],
    (object)['rate' => 3000],
    (object)['rate' => 5000],
];

// select one element from $elems
$elemIdx = \EasyLottery::selectOne($elems);
echo $elemIdx; // e.g, 2

// select one elment or not from $elems 
$elemIdx = \EasyLottery::selectOneOrNot($elems, 10000);
echo $elemIdx; // e.g, 1 or null

Licence

MIT

统计信息

  • 总下载量: 1.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-02