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
f5b42e48
Commit
f5b42e48
authored
Oct 18, 2016
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
79f263c1
818bb51b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
45 deletions
+44
-45
Course.php
src/common/models/Course.php
+1
-1
m160927_115425_course_teacher_init.php
...console/migrations/m160927_115425_course_teacher_init.php
+8
-10
m160927_122843_teacher_init.php
src/console/migrations/m160927_122843_teacher_init.php
+5
-2
m160927_123009_member_init.php
src/console/migrations/m160927_123009_member_init.php
+6
-6
index.php
src/frontend/views/my-member/index.php
+20
-24
publish.js
src/frontend/web/js/my-course/publish.js
+4
-2
No files found.
src/common/models/Course.php
View file @
f5b42e48
...
...
@@ -187,7 +187,7 @@ class Course extends \yii\db\ActiveRecord
*/
public
function
getUser
()
{
return
$this
->
hasOne
(
User
::
className
(),
[
'id'
=>
'user_id'
])
->
select
(
'id,username,role,avatar'
);
;
return
$this
->
hasOne
(
User
::
className
(),
[
'id'
=>
'user_id'
])
->
select
(
'id,username,role,avatar'
);
}
/**
...
...
src/console/migrations/m160927_115425_c
lasses
_teacher_init.php
→
src/console/migrations/m160927_115425_c
ourse
_teacher_init.php
View file @
f5b42e48
...
...
@@ -2,9 +2,9 @@
use
yii\db\Migration
;
class
m160927_115425_c
lasses
_teacher_init
extends
Migration
class
m160927_115425_c
ourse
_teacher_init
extends
Migration
{
public
$table
=
'{{%c
lasses
_teacher}}'
;
public
$table
=
'{{%c
ourse
_teacher}}'
;
public
function
up
()
{
...
...
@@ -15,16 +15,14 @@ class m160927_115425_classes_teacher_init extends Migration
}
$this
->
createTable
(
$this
->
table
,
[
'c
lass_id'
=>
$this
->
integer
(
)
->
notNull
()
->
unsigned
(),
'teacher_id'
=>
$this
->
integer
()
->
notNull
()
->
unsigned
(),
'c
ourse_id'
=>
$this
->
integer
(
10
)
->
notNull
()
->
unsigned
(),
'teacher_id'
=>
$this
->
integer
(
10
)
->
notNull
()
->
unsigned
(),
],
$tableOptions
);
$this
->
addCommentOnTable
(
$this
->
table
,
'讲师课堂关系表'
);
$this
->
addPrimaryKey
(
'pk'
,
$this
->
table
,
[
'class_id'
,
'teacher_id'
]
);
$this
->
addCommentOnTable
(
$this
->
table
,
'讲师课程关系表'
);
$this
->
createIndex
(
'course_id'
,
$this
->
table
,
'course_id'
);
$this
->
createIndex
(
'teacher_id'
,
$this
->
table
,
'teacher_id'
);
}
public
function
down
()
...
...
src/console/migrations/m160927_122843_teacher_init.php
View file @
f5b42e48
...
...
@@ -17,14 +17,17 @@ class m160927_122843_teacher_init extends Migration
$this
->
createTable
(
$this
->
table
,
[
'id'
=>
$this
->
primaryKey
()
->
unsigned
(),
'user_id'
=>
$this
->
integer
()
->
notNull
()
->
unsigned
(),
'class_id'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
(),
'name'
=>
$this
->
string
(
64
)
->
notNull
(),
'avatar'
=>
$this
->
string
(
255
)
->
notNull
(),
'intro'
=>
$this
->
text
()
->
notNull
(
''
),
'intro'
=>
$this
->
text
()
->
notNull
(),
'created_at'
=>
$this
->
integer
()
->
notNull
(),
'updated_at'
=>
$this
->
integer
()
->
notNull
(),
],
$tableOptions
);
$this
->
addCommentOnTable
(
$this
->
table
,
'讲师表'
);
$this
->
createIndex
(
'index-user_id'
,
$this
->
table
,
'user_id'
);
$this
->
createIndex
(
'user_id'
,
$this
->
table
,
'user_id'
);
$this
->
createIndex
(
'class_id'
,
$this
->
table
,
'class_id'
);
}
...
...
src/console/migrations/m160927_123009_member_init.php
View file @
f5b42e48
...
...
@@ -15,12 +15,12 @@ class m160927_123009_member_init extends Migration
}
$this
->
createTable
(
$this
->
table
,
[
'id'
=>
$this
->
primaryKey
()
->
unsigned
(),
'user_id'
=>
$this
->
integer
()
->
notNull
()
->
unsigned
(),
'member_id'
=>
$this
->
integer
()
->
notNull
()
->
unsigned
(),
'type'
=>
$this
->
smallInteger
()
->
notNull
()
->
unsigned
()
->
comment
(
'会员类型 0 未付费 1 付费'
),
'created_at'
=>
$this
->
integer
()
->
notNull
(),
'updated_at'
=>
$this
->
integer
(
)
->
notNull
(),
'id'
=>
$this
->
primaryKey
(
10
)
->
unsigned
(),
'user_id'
=>
$this
->
integer
(
10
)
->
notNull
()
->
unsigned
(),
'member_id'
=>
$this
->
integer
(
10
)
->
notNull
()
->
unsigned
(),
'type'
=>
$this
->
smallInteger
(
1
)
->
notNull
()
->
unsigned
()
->
comment
(
'会员类型 0 未付费 1 付费'
),
'created_at'
=>
$this
->
integer
(
10
)
->
unsigned
(
)
->
notNull
(),
'updated_at'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
()
],
$tableOptions
);
$this
->
addCommentOnTable
(
$this
->
table
,
'用户会员表'
);
$this
->
createIndex
(
'index-user_id'
,
$this
->
table
,
'user_id'
);
...
...
src/frontend/views/my-member/index.php
View file @
f5b42e48
<?php
/* @var $this yii\web\View */
/**
* @var $this yii\web\View
* @var $data array
* @var $pagination \yii\data\Pagination
*/
?>
<div
class=
"vip-top clearfix"
>
<div
class=
"col-md-6"
>
...
...
@@ -31,33 +35,25 @@
</tr>
</thead>
<tbody>
<
tr
>
<t
d>
2016-12-11
</td
>
<td>
18788860327 / 百丐洪七公
</td>
<td>
推广
</td>
<td>
《中国为什么这么久还没有进入社会主义社会》
</td>
<td>
¥123.00
</td
>
</tr
>
<tr
>
<td>
2016-12-11
</td
>
<td>
18788860327 / 百丐洪七公
</td>
<td>
推广
</td>
<td>
《中国为什么这么久还没有进入社会主义社会》
</td
>
<
td>
¥123.00
</td
>
<
/tr
>
<
?php
foreach
(
$data
as
$row
)
{
?
>
<t
r
>
<td>
2016-12-11
</td>
<td>
<?=
$row
[
'user'
][
'telephone'
]
?>
/
<?=
$row
[
'user'
][
'username'
]
?>
</td>
<td>
推广
</td>
<?php
if
(
!
empty
(
$row
[
'firstOrder'
]))
{
?
>
<td>
《
<?=
$row
[
'firstOrder'
][
'course'
][
'name'
]
?>
》
</td
>
<td>
¥
<?=
$row
[
'firstOrder'
][
'credit_total'
]
?>
</td
>
<?php
}
else
{
?
>
<td>
无
</td>
<td>
¥0
</td>
<?php
}
?
>
<
/tr
>
<
?php
}
?
>
</tbody>
</table>
<div
class=
"text-center hide"
>
<ul
class=
"pagination pagination-sm"
>
<li><a
href=
"#"
>
«
</a></li>
<li><a
href=
"#"
>
1
</a></li>
<li><a
href=
"#"
>
2
</a></li>
<li><a
href=
"#"
>
3
</a></li>
<li><a
href=
"#"
>
4
</a></li>
<li><a
href=
"#"
>
5
</a></li>
<li><a
href=
"#"
>
»
</a></li>
</ul>
<?=
\yii\widgets\LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
</div>
</div>
</div>
\ No newline at end of file
src/frontend/web/js/my-course/publish.js
View file @
f5b42e48
...
...
@@ -51,7 +51,7 @@ var vm = new Vue({
var
self
=
this
;
//添加讲师
$
.
post
(
"/teacher-manager/
add
"
,
{
$
.
post
(
"/teacher-manager/
save
"
,
{
name
:
self
.
addTeacherName
},
function
(
t
)
{
if
(
!
t
.
error
)
{
...
...
@@ -169,12 +169,14 @@ var vm = new Vue({
url
:
'/my-course/upload'
,
//文件上传的接口地址
params
:
{
"_csrf-frontend"
:
$
(
"meta[name='csrf-token']"
).
attr
(
"content"
),
tmp
:
self
.
tmp
"tmp"
:
self
.
tmp
},
fileKey
:
'file'
,
//服务器端获取文件数据的参数名
connectionCount
:
3
,
leaveConfirm
:
'正在上传文件'
}
});
editor
;
}
});
\ No newline at end of file
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