You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

<?php
namespace app\models;
use app\models\common\admin\log\CommonActionLog;
use Yii;
/**
* This is the model class for table "{{%goods_card}}".
*
* @property integer $id
* @property integer $goods_id
* @property integer $card_id
* @property integer $is_delete
* @property integer $addtime
*/
class GoodsCard extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%goods_card}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['goods_id', 'card_id', 'is_delete', 'addtime'], 'integer'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'goods_id' => 'Goods ID',
'card_id' => '卡券id',
'is_delete' => 'Is Delete',
'addtime' => 'Addtime',
];
}
public function afterSave($insert, $changedAttributes)
{
$data = $insert ? json_encode($this->attributes) : json_encode($changedAttributes);
CommonActionLog::storeActionLog('', $insert, $this->is_delete, $data, $this->id);
}
}