commit | author | age
|
90c639
|
1 |
<?php |
Z |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
use Yii; |
|
6 |
|
|
7 |
/** |
|
8 |
* This is the model class for table "{{%order_pay_result}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $order_id |
|
12 |
* @property string $data json数据 |
|
13 |
* @property string $created_at |
|
14 |
* @property string $updated_at |
|
15 |
*/ |
|
16 |
class OrderPayResult extends ModelActiveRecord |
|
17 |
{ |
|
18 |
/** |
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public static function tableName() |
|
22 |
{ |
|
23 |
return '{{%order_pay_result}}'; |
|
24 |
} |
|
25 |
|
|
26 |
/** |
|
27 |
* {@inheritdoc} |
|
28 |
*/ |
|
29 |
public function rules() |
|
30 |
{ |
|
31 |
return [ |
|
32 |
[['order_id'], 'required'], |
|
33 |
[['order_id'], 'integer'], |
|
34 |
[['data'], 'string'], |
|
35 |
[['created_at', 'updated_at'], 'safe'], |
|
36 |
]; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* {@inheritdoc} |
|
41 |
*/ |
|
42 |
public function attributeLabels() |
|
43 |
{ |
|
44 |
return [ |
|
45 |
'id' => 'ID', |
|
46 |
'order_id' => 'Order ID', |
|
47 |
'data' => 'json数据', |
|
48 |
'created_at' => 'Created At', |
|
49 |
'updated_at' => 'Updated At', |
|
50 |
]; |
|
51 |
} |
|
52 |
|
|
53 |
public function encodeData($data) |
|
54 |
{ |
|
55 |
return Yii::$app->serializer->encode($data); |
|
56 |
} |
|
57 |
|
|
58 |
public function decodeData($data) |
|
59 |
{ |
|
60 |
return Yii::$app->serializer->decode($data); |
|
61 |
} |
|
62 |
} |