1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace common\models\psources;
use common\core\BaseActiveRecord;
use Yii;
/**
* CoinReleaseMember
*
* @property int $id
* @property int $status
* @property string $address
* @property string $amount
*/
class CoinGameBet extends BaseActiveRecord
{
const SCENARIOS_ADD = 'add';
const SCENARIOS_UPDATE = 'update';
const VAILD_TRUE = 1;
const VAILD_FALSE = 0;
public static function getDb()
{
return Yii::$app->get('p_sources');
}
public static function tableName()
{
return '{{%coin_game_bet}}';
}
public function attributeLabels()
{
return [
'id' => 'ID',
'round' => '地址',
'player' => '数量',
'amount' => '交易hash',
'height' => '状态',
'rand_num' => '状态',
'player_win' => '状态',
];
}
public function rules()
{
return [
[['round', 'amount', 'height', 'guess_num', 'rand_num', 'player_win', 'vaild'], 'int'],
[['player'], 'string']
];
}
public function sercians()
{
return [
self::SCENARIOS_ADD => ['round', 'amount', 'height', 'guess_num', 'rand_num', 'player_win', 'player', 'vaild'],
self::SCENARIOS_UPDATE => ['round', 'amount', 'height', 'guess_num', 'rand_num', 'player_win', 'player', 'vaild'],
];
}
public static function loadArray(array $data)
{
return self::getDb()->createCommand()->batchInsert(self::tableName(),
['round', 'player', 'amount', 'height', 'guess_num', 'rand_num', 'player_win', 'platform'],
$data)->execute();
}
}