cxgj/models/Coupon.php
2023-11-27 09:45:13 +08:00

78 lines
2.5 KiB
PHP

<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "{{%coupon}}".
*
* @property int $id
* @property string $title 卡券标题
* @property int $start_time 开始时间
* @property int $end_time 结束时间
* @property float|null $price 金额
* @property int|null $num 发放数量,-1为不限量
* @property int $type 类型0=体验券1=体验券
* @property string|null $vehicle_ids 指定球车使用,为空则不限制
* @property int|null $created_at
* @property int|null $updated_at
* @property int|null $is_delete
* @property int|null $deleted_at
* @property int|null $get_start_time 领取开始时间
* @property int|null $get_end_time 领取结束时间
* @property int|null $get_num 领取数量
* @property string|null $store_ids 可使用门店id
* @property int|null $user_get_num 用户可领取数量
*/
class Coupon extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%coupon}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['title', 'start_time', 'end_time', 'type'], 'required'],
[['start_time', 'end_time', 'num', 'type', 'created_at', 'updated_at', 'is_delete', 'deleted_at', 'get_start_time', 'get_end_time','get_num','user_get_num'], 'integer'],
[['price'], 'number'],
[['title','store_ids'], 'string', 'max' => 50],
[['vehicle_ids'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'title' => '卡券标题',
'start_time' => '开始时间',
'end_time' => '结束时间',
'price' => '金额',
'num' => '发放数量,-1为不限量',
'type' => '类型0=体验券1=立减券',
'vehicle_ids' => '指定球车使用,为空则不限制',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'is_delete' => 'Is Delete',
'deleted_at' => 'Deleted At',
'get_start_time' => '领取开始时间',
'get_end_time' => '领取结束时间',
'get_num' => '领取数量',
'store_ids' => '可使用门店',
'user_get_num' => '用户可领取数量',
];
}
}