Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
d98aa8a3
Commit
d98aa8a3
authored
Sep 28, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加代码
parent
9d0befab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
Course.php
src/common/models/Course.php
+88
-0
No files found.
src/common/models/Course.php
0 → 100644
View file @
d98aa8a3
<?php
namespace
common\models
;
use
Yii
;
use
yii\behaviors\TimestampBehavior
;
use
yii\redis\ActiveRecord
;
/**
* This is the model class for table "course".
*
* @property integer $id
* @property integer $user_id
* @property integer $classed_id
* @property string $avatar
* @property string $name
* @property integer $price
* @property integer $free_time
* @property string $intro
* @property string $preview_pic
* @property integer $recommend
* @property integer $status
* @property integer $created_at
* @property integer $updated_at
*/
class
Course
extends
\yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public
static
function
tableName
()
{
return
'course'
;
}
/**
* @inheritdoc
*/
public
function
behaviors
()
{
return
[
[
'class'
=>
TimestampBehavior
::
className
(),
'attributes'
=>
[
ActiveRecord
::
EVENT_BEFORE_INSERT
=>
[
'created_at'
,
'updated_at'
],
ActiveRecord
::
EVENT_BEFORE_UPDATE
=>
[
'updated_at'
],
],
// if you're using datetime instead of UNIX timestamp:
// 'value' => new Expression('NOW()'),
],];
}
/**
* @inheritdoc
*/
public
function
rules
()
{
return
[
[[
'user_id'
,
'classed_id'
,
'avatar'
,
'name'
,
'price'
,
'free_time'
,
'intro'
,
'preview_pic'
],
'required'
],
[[
'user_id'
,
'classed_id'
,
'price'
,
'free_time'
,
'recommend'
,
'status'
,
'created_at'
,
'updated_at'
],
'integer'
],
[[
'intro'
],
'string'
],
[[
'avatar'
,
'preview_pic'
],
'string'
,
'max'
=>
255
],
[[
'name'
],
'string'
,
'max'
=>
32
],
];
}
/**
* @inheritdoc
*/
public
function
attributeLabels
()
{
return
[
'id'
=>
'ID'
,
'user_id'
=>
'User ID'
,
'classed_id'
=>
'Classed ID'
,
'avatar'
=>
'Avatar'
,
'name'
=>
'Name'
,
'price'
=>
'Price'
,
'free_time'
=>
'Free Time'
,
'intro'
=>
'Intro'
,
'preview_pic'
=>
'Preview Pic'
,
'recommend'
=>
'0 表示推荐 1推荐'
,
'status'
=>
'0 未审核 1 审核通过 2 审核不通过 3 锁定 '
,
'created_at'
=>
'Created At'
,
'updated_at'
=>
'Updated At'
,
];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment