1234567891011121314151617181920212223242526272829303132 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/3/4
- * Time: 上午11:51
- */
- use app\common\library\Redis;
- use app\main\constants\CacheConstants;
- use app\main\service\FloatTipsService;
- class FloatTipsTest extends TestInit
- {
- public function testInit()
- {
- $match = [
- ['weight'=>2, 'id'=>1],
- ['weight'=>2, 'id'=>2],
- ];
- usort($match, function ($v1, $v2) {
- if ($v2['weight'] > $v1['weight']) {
- return true;
- }
- if ($v2['id'] > $v1['id']) {
- return true;
- }
- return false;
- });
- var_dump($match);
- }
- }
|