Commit c3fad6d6 authored by xiabin's avatar xiabin

修改价格字段

parent 2fdfff1a
......@@ -13,14 +13,18 @@ use yii\redis\ActiveRecord;
*
* @property integer $id
* @property integer $user_id
* @property integer $classed_id
* @property integer $class_id
* @property string $name
* @property integer $price
* @property string $price
* @property integer $free_time
* @property string $intro
* @property string $preview_pic
* @property integer $recommend
* @property integer $status
* @property integer $play_count
* @property integer $comment_count
* @property integer $favorite_count
* @property integer $support_count
* @property integer $created_at
* @property integer $updated_at
*/
......@@ -80,7 +84,7 @@ class Course extends \yii\db\ActiveRecord
['name', 'string', 'length' => [1, 60]],
[['user_id', 'class_id'], 'integer'],
['intro', 'string'],
['price', 'integer', 'min' => 0, 'max' => 9999],
[['price'], 'number'],
['free_time', 'integer', 'min' => 0, 'max' => 15],
['recommend', 'boolean'],
[['recommend', 'comment_count', 'favorite_count', 'support_count', 'play_count'], 'default', 'value' => 0],
......@@ -94,13 +98,22 @@ class Course extends \yii\db\ActiveRecord
public function attributeLabels()
{
return [
'teacher' => '讲师',
'name' => '标题',
'price' => '价格',
'free_time' => '免费试看',
'intro' => '课程介绍',
'preview_pic' => '预览图',
'favorite_count' => 'favorite_count'
'id' => 'ID',
'user_id' => 'User ID',
'class_id' => 'Class ID',
'name' => 'Name',
'price' => 'Price',
'free_time' => 'Free Time',
'intro' => 'Intro',
'preview_pic' => 'Preview Pic',
'recommend' => '0 表示推荐 1推荐',
'status' => '0 未审核 1 审核通过 2 审核不通过 3 锁定 ',
'play_count' => '播放次数',
'comment_count' => '评论次数',
'favorite_count' => '收藏次数',
'support_count' => '点赞次数',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
......
......@@ -60,7 +60,8 @@ class Orders extends \yii\db\ActiveRecord
return [
[['user_id', 'course_id', 'number', 'credit', 'pay_order'], 'required'],
[['user_id', 'course_id', 'status', 'created_at', 'updated_at'], 'integer'],
[['number', 'credit'], 'string', 'max' => 32],
[['number'], 'string', 'max' => 32],
[['credit'], 'number'],
[['pay_order'], 'string', 'max' => 64],
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment