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
9622fc21
Commit
9622fc21
authored
Oct 27, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审核未通过时记录原因用于后续页面显示
parent
59fe3792
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
4 deletions
+21
-4
ClassesController.php
src/backend/controllers/ClassesController.php
+5
-0
CourseController.php
src/backend/controllers/CourseController.php
+3
-0
index.php
src/backend/views/course/index.php
+0
-1
Utils.php
src/common/libs/Utils.php
+6
-0
Classes.php
src/common/models/Classes.php
+2
-1
Course.php
src/common/models/Course.php
+2
-1
m160927_115114_classes_init.php
src/console/migrations/m160927_115114_classes_init.php
+1
-0
m160927_121107_course_init.php
src/console/migrations/m160927_121107_course_init.php
+2
-1
No files found.
src/backend/controllers/ClassesController.php
View file @
9622fc21
...
@@ -78,6 +78,7 @@ class ClassesController extends Controller
...
@@ -78,6 +78,7 @@ class ClassesController extends Controller
switch
(
$check
)
{
switch
(
$check
)
{
case
Classes
::
STATUS_OK
:
case
Classes
::
STATUS_OK
:
$class
->
status
=
$check
;
$class
->
status
=
$check
;
$class
->
reason
=
''
;
if
(
$class
->
save
()
&&
$msg
)
{
if
(
$class
->
save
()
&&
$msg
)
{
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.ok'
];
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.ok'
];
$sms
->
send
(
$user
->
telephone
,
str_replace
(
'{className}'
,
$class
->
name
,
$template
));
$sms
->
send
(
$user
->
telephone
,
str_replace
(
'{className}'
,
$class
->
name
,
$template
));
...
@@ -93,6 +94,8 @@ class ClassesController extends Controller
...
@@ -93,6 +94,8 @@ class ClassesController extends Controller
}
}
$class
->
status
=
$check
;
$class
->
status
=
$check
;
$class
->
reason
=
$reason
;
if
(
$class
->
save
()
&&
$msg
)
{
if
(
$class
->
save
()
&&
$msg
)
{
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.failed'
];
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.failed'
];
$sms
->
send
(
$user
->
telephone
,
str_replace
([
'{className}'
,
'{reason}'
],
[
$class
->
name
,
$reason
],
$template
));
$sms
->
send
(
$user
->
telephone
,
str_replace
([
'{className}'
,
'{reason}'
],
[
$class
->
name
,
$reason
],
$template
));
...
@@ -109,6 +112,8 @@ class ClassesController extends Controller
...
@@ -109,6 +112,8 @@ class ClassesController extends Controller
}
}
$class
->
status
=
$check
;
$class
->
status
=
$check
;
$class
->
reason
=
$reason
;
if
(
$class
->
save
()
&&
$msg
)
{
if
(
$class
->
save
()
&&
$msg
)
{
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.locked'
];
$template
=
Yii
::
$app
->
params
[
'classes.check.msg.locked'
];
$sms
->
send
(
$user
->
telephone
,
str_replace
([
'{className}'
,
'{reason}'
],
[
$class
->
name
,
$reason
],
$template
));
$sms
->
send
(
$user
->
telephone
,
str_replace
([
'{className}'
,
'{reason}'
],
[
$class
->
name
,
$reason
],
$template
));
...
...
src/backend/controllers/CourseController.php
View file @
9622fc21
...
@@ -122,6 +122,7 @@ class CourseController extends Controller
...
@@ -122,6 +122,7 @@ class CourseController extends Controller
}
}
$course
->
status
=
$check
;
$course
->
status
=
$check
;
$course
->
reason
=
''
;
$courseware
->
status
=
$check
;
$courseware
->
status
=
$check
;
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
...
@@ -140,6 +141,7 @@ class CourseController extends Controller
...
@@ -140,6 +141,7 @@ class CourseController extends Controller
}
}
$course
->
status
=
$check
;
$course
->
status
=
$check
;
$course
->
reason
=
$reason
;
$courseware
->
status
=
Courseware
::
STATUS_FAILED
;
$courseware
->
status
=
Courseware
::
STATUS_FAILED
;
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
...
@@ -158,6 +160,7 @@ class CourseController extends Controller
...
@@ -158,6 +160,7 @@ class CourseController extends Controller
}
}
$course
->
status
=
$check
;
$course
->
status
=
$check
;
$course
->
reason
=
$reason
;
$courseware
->
status
=
Courseware
::
STATUS_LOCKED
;
$courseware
->
status
=
Courseware
::
STATUS_LOCKED
;
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
if
(
$course
->
save
()
&&
$courseware
->
save
()
&&
$msg
)
{
...
...
src/backend/views/course/index.php
View file @
9622fc21
...
@@ -39,7 +39,6 @@ $qiniu = \Yii::$app->qiniu;
...
@@ -39,7 +39,6 @@ $qiniu = \Yii::$app->qiniu;
<li
<?php
if
(
$status
==
Course
::
STATUS_LOCKED
)
{
?>
class=
"active"
<?php
}
?>
><a
href=
"
<?=
Url
::
to
([
'course/index'
,
'status'
=>
Course
::
STATUS_LOCKED
])
?>
"
><i
class=
"fa fa-lock"
></i>
已锁定
</a></li>
<li
<?php
if
(
$status
==
Course
::
STATUS_LOCKED
)
{
?>
class=
"active"
<?php
}
?>
><a
href=
"
<?=
Url
::
to
([
'course/index'
,
'status'
=>
Course
::
STATUS_LOCKED
])
?>
"
><i
class=
"fa fa-lock"
></i>
已锁定
</a></li>
</ul>
</ul>
</div>
</div>
<!-- /.box-body -->
</div>
</div>
<?php
if
(
$count
>
0
)
{
?>
<?php
if
(
$count
>
0
)
{
?>
...
...
src/common/libs/Utils.php
View file @
9622fc21
...
@@ -207,6 +207,12 @@ class Utils
...
@@ -207,6 +207,12 @@ class Utils
return
$count
;
return
$count
;
}
}
/**
* 将字节数转换为可读文件大小
*
* @param int $bytes
* @return string
*/
public
static
function
byteConvert
(
$bytes
)
public
static
function
byteConvert
(
$bytes
)
{
{
if
(
$bytes
==
0
)
if
(
$bytes
==
0
)
...
...
src/common/models/Classes.php
View file @
9622fc21
...
@@ -18,6 +18,7 @@ use yii\db\ActiveRecord;
...
@@ -18,6 +18,7 @@ use yii\db\ActiveRecord;
* @property string $intro
* @property string $intro
* @property string $desc
* @property string $desc
* @property integer $status
* @property integer $status
* @property string $reason
* @property integer $created_at
* @property integer $created_at
* @property integer $updated_at
* @property integer $updated_at
*/
*/
...
@@ -65,7 +66,7 @@ class Classes extends ActiveRecord
...
@@ -65,7 +66,7 @@ class Classes extends ActiveRecord
return
[
return
[
[[
'user_id'
,
'name'
,
'intro'
],
'required'
],
[[
'user_id'
,
'name'
,
'intro'
],
'required'
],
[[
'user_id'
,
'status'
],
'integer'
],
[[
'user_id'
,
'status'
],
'integer'
],
[[
'intro'
,
'desc'
],
'string'
],
[[
'intro'
,
'desc'
,
'reason'
],
'string'
],
[[
'name'
],
'string'
,
'max'
=>
30
],
[[
'name'
],
'string'
,
'max'
=>
30
],
];
];
}
}
...
...
src/common/models/Course.php
View file @
9622fc21
...
@@ -22,6 +22,7 @@ use yii\redis\ActiveRecord;
...
@@ -22,6 +22,7 @@ use yii\redis\ActiveRecord;
* @property string $preview_pic
* @property string $preview_pic
* @property integer $recommend
* @property integer $recommend
* @property integer $status
* @property integer $status
* @property string $reason
* @property integer $play_count
* @property integer $play_count
* @property integer $comment_count
* @property integer $comment_count
* @property integer $favorite_count
* @property integer $favorite_count
...
@@ -85,7 +86,7 @@ class Course extends \yii\db\ActiveRecord
...
@@ -85,7 +86,7 @@ class Course extends \yii\db\ActiveRecord
[[
'name'
,
'preview_pic'
],
'required'
],
[[
'name'
,
'preview_pic'
],
'required'
],
[
'name'
,
'string'
,
'length'
=>
[
1
,
60
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
60
]],
[[
'user_id'
,
'class_id'
],
'integer'
],
[[
'user_id'
,
'class_id'
],
'integer'
],
[
'intro'
,
'string'
],
[
[
'intro'
,
'reason'
]
,
'string'
],
[[
'price'
],
'number'
],
[[
'price'
],
'number'
],
[
'free_time'
,
'integer'
,
'min'
=>
0
,
'max'
=>
15
],
[
'free_time'
,
'integer'
,
'min'
=>
0
,
'max'
=>
15
],
[
'recommend'
,
'boolean'
],
[
'recommend'
,
'boolean'
],
...
...
src/console/migrations/m160927_115114_classes_init.php
View file @
9622fc21
...
@@ -23,6 +23,7 @@ class m160927_115114_classes_init extends Migration
...
@@ -23,6 +23,7 @@ class m160927_115114_classes_init extends Migration
'intro'
=>
$this
->
text
()
->
notNull
(),
'intro'
=>
$this
->
text
()
->
notNull
(),
'desc'
=>
$this
->
text
()
->
notNull
()
->
comment
(
'案例资源'
),
'desc'
=>
$this
->
text
()
->
notNull
()
->
comment
(
'案例资源'
),
'status'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 未审核 1 审核通过 2 审核不通过 3 锁定 '
),
'status'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 未审核 1 审核通过 2 审核不通过 3 锁定 '
),
'reason'
=>
$this
->
string
(
128
)
->
notNull
()
->
comment
(
'未审核通过时的原因'
),
'created_at'
=>
$this
->
integer
()
->
notNull
(),
'created_at'
=>
$this
->
integer
()
->
notNull
(),
'updated_at'
=>
$this
->
integer
()
->
notNull
(),
'updated_at'
=>
$this
->
integer
()
->
notNull
(),
],
$tableOptions
);
],
$tableOptions
);
...
...
src/console/migrations/m160927_121107_course_init.php
View file @
9622fc21
...
@@ -22,8 +22,9 @@ class m160927_121107_course_init extends Migration
...
@@ -22,8 +22,9 @@ class m160927_121107_course_init extends Migration
'price'
=>
$this
->
decimal
(
6
,
2
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
),
'price'
=>
$this
->
decimal
(
6
,
2
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
),
'free_time'
=>
$this
->
integer
(
10
)
->
notNull
()
->
defaultValue
(
0
),
'free_time'
=>
$this
->
integer
(
10
)
->
notNull
()
->
defaultValue
(
0
),
'intro'
=>
$this
->
text
()
->
notNull
(),
'intro'
=>
$this
->
text
()
->
notNull
(),
'preview_pic'
=>
$this
->
string
(
2
55
)
->
notNull
(),
'preview_pic'
=>
$this
->
string
(
2
00
)
->
notNull
(),
'recommend'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 表示推荐 1推荐'
),
'recommend'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 表示推荐 1推荐'
),
'reason'
=>
$this
->
string
(
128
)
->
notNull
()
->
comment
(
'未审核通过时的原因'
),
'status'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 未审核 1 审核通过 2 审核不通过 3 锁定 '
),
'status'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0 未审核 1 审核通过 2 审核不通过 3 锁定 '
),
'play_count'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'播放次数'
),
'play_count'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'播放次数'
),
'comment_count'
=>
$this
->
integer
(
8
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'评论次数'
),
'comment_count'
=>
$this
->
integer
(
8
)
->
unsigned
()
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'评论次数'
),
...
...
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