Completed
Push — master ( 647ef8...103d46 )
by zacksleo
10:04
created

OrderPaymentRecord::tableName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace zacksleo\yii2\shop\models;
4
5
use yii\behaviors\TimestampBehavior;
6
7
/**
8
 * This is the model class for table "{{%order_payment_record}}".
9
 *
10
 * @property integer $id
11
 * @property string $order_sn
12
 * @property string $trace_no
13
 * @property string $amount
14
 * @property integer $created_at
15
 * @property integer $updated_at
16
 */
17
class OrderPaymentRecord extends \yii\db\ActiveRecord
18
{
19
    /**
20
     * @inheritdoc
21
     */
22
    public static function tableName()
23
    {
24
        return '{{%order_payment_record}}';
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function rules()
31
    {
32
        return [
33
            [['order_sn'], 'required'],
34
            [['amount'], 'number'],
35
            [['created_at', 'updated_at'], 'integer'],
36
            [['order_sn', 'trace_no'], 'string', 'max' => 255],
37
        ];
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function attributeLabels()
44
    {
45
        return [
46
            'id' => 'ID',
47
            'order_sn' => '订单编号',
48
            'trace_no' => '交易号',
49
            'amount' => '总金额',
50
            'created_at' => '创建时间',
51
            'updated_at' => '更新时间',
52
        ];
53
    }
54
55
    /**
56
     * @inheritdoc
57
     */
58
    public function behaviors()
59
    {
60
        return [
61
            'timestamp' => [
62
                'class' => TimestampBehavior::className()
63
            ]
64
        ];
65
    }
66
}
67