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
8e1f2852
Commit
8e1f2852
authored
Oct 26, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录时更新数据库时间
migrate 增加
parent
7364a947
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
5 deletions
+53
-5
main.php
src/backend/config/main.php
+4
-0
SiteController.php
src/backend/controllers/SiteController.php
+3
-2
Course.php
src/common/models/Course.php
+2
-2
m161026_085127_transcode_queue.php
src/console/migrations/m161026_085127_transcode_queue.php
+1
-1
m161026_111007_admin_users.php
src/console/migrations/m161026_111007_admin_users.php
+43
-0
No files found.
src/backend/config/main.php
View file @
8e1f2852
...
@@ -20,6 +20,10 @@ return [
...
@@ -20,6 +20,10 @@ return [
'identityClass'
=>
'backend\models\User'
,
'identityClass'
=>
'backend\models\User'
,
'enableAutoLogin'
=>
true
,
'enableAutoLogin'
=>
true
,
'identityCookie'
=>
[
'name'
=>
'_identity-backend'
,
'httpOnly'
=>
true
],
'identityCookie'
=>
[
'name'
=>
'_identity-backend'
,
'httpOnly'
=>
true
],
'on afterLogin'
=>
function
(
$event
)
{
$event
->
identity
->
logged_at
=
time
();
$event
->
identity
->
update
();
}
],
],
'session'
=>
[
'session'
=>
[
// this is the name of the session cookie used for login on the backend
// this is the name of the session cookie used for login on the backend
...
...
src/backend/controllers/SiteController.php
View file @
8e1f2852
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
namespace
backend\controllers
;
namespace
backend\controllers
;
use
backend\models\LoginForm
;
use
backend\models\LoginForm
;
use
backend\models\User
;
use
common\libs\Utils
;
use
Yii
;
use
Yii
;
use
yii\base\Event
;
use
yii\web\Controller
;
use
yii\web\Controller
;
use
yii\filters\AccessControl
;
use
yii\filters\AccessControl
;
use
yii\web\User
;
/**
/**
* Site controller
* Site controller
...
@@ -82,6 +82,7 @@ class SiteController extends Controller
...
@@ -82,6 +82,7 @@ class SiteController extends Controller
}
}
$model
=
new
LoginForm
();
$model
=
new
LoginForm
();
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
login
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
login
())
{
return
$this
->
goBack
();
return
$this
->
goBack
();
}
else
{
}
else
{
...
...
src/common/models/Course.php
View file @
8e1f2852
...
@@ -254,9 +254,9 @@ class Course extends \yii\db\ActiveRecord
...
@@ -254,9 +254,9 @@ class Course extends \yii\db\ActiveRecord
return
self
::
find
()
->
where
(
$where
)
->
sum
(
'comment_count'
);
return
self
::
find
()
->
where
(
$where
)
->
sum
(
'comment_count'
);
}
}
public
static
function
url
(
$courseId
,
$schema
=
false
)
public
static
function
url
(
$courseId
)
{
{
return
Url
::
to
([
'home/video'
,
'courseId'
=>
$courseId
],
$schema
);
return
\Yii
::
$app
->
params
[
'baseUrl'
]
.
Url
::
to
([
'home/video'
,
'courseId'
=>
$courseId
]
);
}
}
/**
/**
...
...
src/console/migrations/m161026_085127_transcode_queue.php
View file @
8e1f2852
...
@@ -5,7 +5,7 @@ use yii\db\Migration;
...
@@ -5,7 +5,7 @@ use yii\db\Migration;
class
m161026_085127_transcode_queue
extends
Migration
class
m161026_085127_transcode_queue
extends
Migration
{
{
public
$table
=
'{{%ranscode_queue}}'
;
public
$table
=
'{{%
t
ranscode_queue}}'
;
public
function
up
()
public
function
up
()
{
{
...
...
src/console/migrations/m161026_111007_admin_users.php
0 → 100644
View file @
8e1f2852
<?php
use
yii\db\Migration
;
class
m161026_111007_admin_users
extends
Migration
{
public
$table
=
'{{%admin_users}}'
;
public
function
up
()
{
$this
->
createTable
(
$this
->
table
,
[
'id'
=>
$this
->
primaryKey
(
10
)
->
unsigned
()
->
notNull
(),
'username'
=>
$this
->
string
(
50
)
->
notNull
(),
'auth_key'
=>
$this
->
string
(
30
)
->
notNull
(),
'password_hash'
=>
$this
->
string
(
255
)
->
notNull
(),
'status'
=>
$this
->
smallInteger
(
2
)
->
notNull
()
->
defaultValue
(
0
)
->
comment
(
'0正常, 1锁定'
),
'ip'
=>
$this
->
string
(
32
)
->
notNull
(),
'created_at'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
(),
'updated_at'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
(),
'logged_at'
=>
$this
->
integer
(
10
)
->
unsigned
()
->
notNull
()
]);
$this
->
addCommentOnTable
(
$this
->
table
,
'管理员用户'
);
$this
->
createIndex
(
'uesrname'
,
$this
->
table
,
'username'
,
true
);
}
public
function
down
()
{
$this
->
dropTable
(
$this
->
table
);
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}
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