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