1 | <?php |
||
24 | class Order extends \yii\db\ActiveRecord |
||
25 | { |
||
26 | const PAYMENT_METHOD_ALIPAY = 1; |
||
27 | const PAYMENT_METHOD_WECHATPAY = 2; |
||
28 | const PAYMENT_METHOD_QRCODE = 3; |
||
29 | |||
30 | const STATUS_DELETED = -2; //已删除 |
||
31 | const STATUS_CANCELED = -1; //已取消 |
||
32 | const STATUS_UNPAID = 0; //未支付 |
||
33 | const STATUS_PAID = 1; //已支付 |
||
34 | const STATUS_CONSUMED = 2; //已消费 |
||
35 | |||
36 | /** |
||
37 | * @inheritdoc |
||
38 | */ |
||
39 | 1 | public static function tableName() |
|
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | 1 | public function rules() |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 1 | public function attributeLabels() |
|
77 | |||
78 | /** |
||
79 | * @inheritdoc |
||
80 | */ |
||
81 | 2 | public function behaviors() |
|
89 | |||
90 | 1 | public function beforeSave($insert) |
|
97 | |||
98 | /** |
||
99 | * 产生序列号 |
||
100 | * @param string $prefix 序列号前缀 |
||
101 | * @return string |
||
102 | * @link http://goo.gl/TZYwZo 参考说明 |
||
103 | */ |
||
104 | 1 | public function createSN($prefix = '') |
|
108 | |||
109 | 1 | public static function getStatusList() |
|
119 | |||
120 | 1 | public static function getPaymentMethodList() |
|
128 | |||
129 | /** |
||
130 | * @return \yii\db\ActiveQuery |
||
131 | */ |
||
132 | public function getOrderPaymentRecord() |
||
136 | } |
||
137 |