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
dd751d5d
Commit
dd751d5d
authored
Oct 18, 2016
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.fingerage.com:999/xiabin/zuiketang
parents
998e8657
33733ea3
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
505 additions
and
61 deletions
+505
-61
AppAsset.php
src/backend/assets/AppAsset.php
+0
-1
Qiniu.php
src/common/components/Qiniu.php
+4
-2
Course.php
src/common/models/Course.php
+30
-1
Income.php
src/common/models/Income.php
+42
-6
Orders.php
src/common/models/Orders.php
+3
-0
main-local.php
src/environments/prod/backend/config/main-local.php
+5
-1
index-test.php
src/environments/prod/backend/web/index-test.php
+25
-0
index.php
src/environments/prod/backend/web/index.php
+8
-2
main-local.php
src/environments/prod/common/config/main-local.php
+42
-3
params-local.php
src/environments/prod/common/config/params-local.php
+36
-0
main-local.php
src/environments/prod/console/config/main-local.php
+1
-0
main-local.php
src/environments/prod/frontend/config/main-local.php
+15
-3
index-test.php
src/environments/prod/frontend/web/index-test.php
+24
-0
index.php
src/environments/prod/frontend/web/index.php
+6
-0
AppAsset.php
src/frontend/assets/AppAsset.php
+2
-1
ClassesInfoController.php
src/frontend/controllers/ClassesInfoController.php
+23
-4
HomeController.php
src/frontend/controllers/HomeController.php
+4
-3
MyIncomeController.php
src/frontend/controllers/MyIncomeController.php
+29
-2
MyMemberController.php
src/frontend/controllers/MyMemberController.php
+3
-0
QiniuCallbackController.php
src/frontend/controllers/QiniuCallbackController.php
+3
-2
index.php
src/frontend/views/classes-info/index.php
+10
-5
video.php
src/frontend/views/home/video.php
+18
-0
classCenter.php
src/frontend/views/layouts/classCenter.php
+1
-1
index.php
src/frontend/views/my-course/index.php
+4
-1
index.php
src/frontend/views/my-income/index.php
+2
-2
index.php
src/frontend/views/my-member/index.php
+59
-5
video-play.vue
src/frontend/web/js/home/components/video-play.vue
+96
-8
video.js
src/frontend/web/js/home/video.js
+10
-8
No files found.
src/backend/assets/AppAsset.php
View file @
dd751d5d
...
@@ -12,7 +12,6 @@ class AppAsset extends AssetBundle
...
@@ -12,7 +12,6 @@ class AppAsset extends AssetBundle
public
$basePath
=
'@webroot'
;
public
$basePath
=
'@webroot'
;
public
$baseUrl
=
'@web'
;
public
$baseUrl
=
'@web'
;
public
$css
=
[
public
$css
=
[
'css/site.css'
,
];
];
public
$js
=
[
public
$js
=
[
];
];
...
...
src/common/components/Qiniu.php
View file @
dd751d5d
...
@@ -134,14 +134,16 @@ class Qiniu extends Object
...
@@ -134,14 +134,16 @@ class Qiniu extends Object
$config
=
$this
->
storages
[
$storage
];
$config
=
$this
->
storages
[
$storage
];
$callbackUrl
=
Url
::
to
([
'qiniu-callback/rem-upload'
],
true
);
$callbackUrl
=
YII_ENV
==
'dev'
?
'http://t.pp.cc/tmp/qiniu_callback.php'
:
Url
::
to
([
'qiniu-callback/rem-upload'
],
true
);
$policy
=
[
$policy
=
[
'returnBody'
=>
'{"key":$(key)}'
,
'returnBody'
=>
'{"key":$(key)}'
,
'saveKey'
=>
$filename
,
'saveKey'
=>
$filename
,
'fsizeLimit'
=>
$config
[
'fsizeLimit'
],
'fsizeLimit'
=>
$config
[
'fsizeLimit'
],
'mimeLimit'
=>
$config
[
'mimeLimit'
],
'mimeLimit'
=>
$config
[
'mimeLimit'
],
'callbackUrl'
=>
'http://t.pp.cc/tmp/qiniu_callback.php'
,
'callbackUrl'
=>
$callbackUrl
,
'callbackBody'
=>
'key=$(key)&storage='
.
$storage
.
'&bucket='
.
$config
[
'bucket'
]
'callbackBody'
=>
'key=$(key)&storage='
.
$storage
.
'&bucket='
.
$config
[
'bucket'
]
.
'&uuid=$(uuid)&time=$(year)-$(mon)-$(day)+$(hour)%3A$(min)%3A$(sec)&fsize=$(fsize)'
.
'&uuid=$(uuid)&time=$(year)-$(mon)-$(day)+$(hour)%3A$(min)%3A$(sec)&fsize=$(fsize)'
.
'&w=$(imageInfo.width)&h=$(imageInfo.height)'
.
'&w=$(imageInfo.width)&h=$(imageInfo.height)'
...
...
src/common/models/Course.php
View file @
dd751d5d
...
@@ -119,7 +119,7 @@ class Course extends \yii\db\ActiveRecord
...
@@ -119,7 +119,7 @@ class Course extends \yii\db\ActiveRecord
* @param $id
* @param $id
* @return array|null|\yii\db\ActiveRecord
* @return array|null|\yii\db\ActiveRecord
*/
*/
public
static
function
getBasicData
(
$id
)
public
static
function
findBaseInfoByCourseId
(
$id
)
{
{
$query
=
self
::
find
();
$query
=
self
::
find
();
return
$query
->
select
(
'id,user_id,class_id,name,price,preview_pic,recommend,status,created_at,updated_at'
)
return
$query
->
select
(
'id,user_id,class_id,name,price,preview_pic,recommend,status,created_at,updated_at'
)
...
@@ -189,4 +189,33 @@ class Course extends \yii\db\ActiveRecord
...
@@ -189,4 +189,33 @@ class Course extends \yii\db\ActiveRecord
{
{
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'
);;
}
}
/**
* 统计指定用户发布的课程数量
*
* @param int $userId
* @param int $status 默认只统计审核通过的,设为 null 则统计全部
* @return int
*/
public
static
function
countCourseByUserId
(
$userId
,
$status
=
self
::
STATUS_OK
)
{
$where
=
[
'user_id'
=>
$userId
];
$status
!==
null
&&
$where
[
'status'
]
=
$status
;
return
self
::
find
()
->
where
(
$where
)
->
count
();
}
/**
* 统计指定用户发布课程的评论总数
*
* @param int $userId
* @param int $status 默认只统计审核通过的课程评论,设为 null 则统计全部
* @return int
*/
public
static
function
countCommentsByUserId
(
$userId
,
$status
=
self
::
STATUS_OK
)
{
$where
=
[
'user_id'
=>
$userId
];
$status
!==
null
&&
$where
[
'status'
]
=
$status
;
return
self
::
find
()
->
where
(
$where
)
->
sum
(
'comment_count'
);
}
}
}
src/common/models/Income.php
View file @
dd751d5d
...
@@ -75,6 +75,7 @@ class Income extends \yii\db\ActiveRecord
...
@@ -75,6 +75,7 @@ class Income extends \yii\db\ActiveRecord
}
}
/**
/**
* 关联订单详细数据
* @return $this
* @return $this
*/
*/
public
function
getOrder
()
public
function
getOrder
()
...
@@ -83,16 +84,18 @@ class Income extends \yii\db\ActiveRecord
...
@@ -83,16 +84,18 @@ class Income extends \yii\db\ActiveRecord
}
}
/**
/**
* @param $userId
* 获取指定用户已出售课程的订单列表
* @param int $page
*
* @param int $num
* @param int $userId
* @param int $status
* @param int $page 页数,默认0为第1页,传null则使用系统自动分页
* @param int $num 每页数量
* @param int $status 要获取的状态,默认为全部
* @return array
* @return array
*/
*/
public
static
function
getIncomeListByUserId
(
$userId
,
$page
=
0
,
$num
=
10
,
$status
=
self
::
STATUS_NOT_SETTLED
)
public
static
function
getIncomeListByUserId
(
$userId
,
$page
=
0
,
$num
=
10
,
$status
=
null
)
{
{
$where
=
[
'user_id'
=>
$userId
];
$where
=
[
'user_id'
=>
$userId
];
$status
!=
null
&&
$where
[
'status'
]
=
$status
;
$status
!=
=
null
&&
$where
[
'status'
]
=
$status
;
$count
=
self
::
find
()
->
where
(
$where
)
->
count
();
$count
=
self
::
find
()
->
where
(
$where
)
->
count
();
$return
=
[
'count'
=>
$count
,
'data'
=>
[]];
$return
=
[
'count'
=>
$count
,
'data'
=>
[]];
...
@@ -112,4 +115,37 @@ class Income extends \yii\db\ActiveRecord
...
@@ -112,4 +115,37 @@ class Income extends \yii\db\ActiveRecord
return
$return
;
return
$return
;
}
}
/**
* 获取售出课程订单的资金统计
*
* @param int $userId
* @param int $status
* @return float
*/
public
static
function
getMoneyTotal
(
$userId
,
$status
=
null
)
{
$where
=
[
'i.user_id'
=>
$userId
];
$status
!==
null
&&
$where
[
'i.status'
]
=
$status
;
return
(
float
)
self
::
find
()
->
alias
(
'i'
)
->
where
(
$where
)
->
join
(
'LEFT JOIN'
,
Orders
::
tableName
()
.
' o'
,
'o.id=i.orders_id'
)
->
sum
(
'o.credit'
);
}
/**
* 统计指定用户时间范围内的收入
*
* @param int $userId
* @param int $timeBetween 起始时间戳
* @param int $timeAnd 结束时间戳
* @return float
*/
public
static
function
getMoneyTotalByTime
(
$userId
,
$timeBetween
,
$timeAnd
)
{
return
(
float
)
self
::
find
()
->
alias
(
'i'
)
->
join
(
'LEFT JOIN'
,
Orders
::
tableName
()
.
' o'
,
'o.id=i.orders_id'
)
->
where
([
'i.user_id'
=>
$userId
])
->
andWhere
([
'between'
,
'i.updated_at'
,
$timeBetween
,
$timeAnd
])
->
sum
(
'o.credit'
);
}
}
}
src/common/models/Orders.php
View file @
dd751d5d
...
@@ -125,6 +125,7 @@ class Orders extends \yii\db\ActiveRecord
...
@@ -125,6 +125,7 @@ class Orders extends \yii\db\ActiveRecord
}
}
/**
/**
* 关联下单用户信息
* @return $this
* @return $this
*/
*/
public
function
getUser
()
public
function
getUser
()
...
@@ -133,6 +134,7 @@ class Orders extends \yii\db\ActiveRecord
...
@@ -133,6 +134,7 @@ class Orders extends \yii\db\ActiveRecord
}
}
/**
/**
* 关联课程信息
* @return $this
* @return $this
*/
*/
public
function
getCourse
()
public
function
getCourse
()
...
@@ -141,6 +143,7 @@ class Orders extends \yii\db\ActiveRecord
...
@@ -141,6 +143,7 @@ class Orders extends \yii\db\ActiveRecord
}
}
/**
/**
* 关联课程信息(包括课程的讲师列表)
* @return $this
* @return $this
*/
*/
public
function
getCourseWithTeachers
()
public
function
getCourseWithTeachers
()
...
...
src/environments/prod/backend/config/main-local.php
View file @
dd751d5d
<?php
<?php
return
[
$config
=
[
'components'
=>
[
'components'
=>
[
'request'
=>
[
'request'
=>
[
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
...
@@ -7,3 +8,6 @@ return [
...
@@ -7,3 +8,6 @@ return [
],
],
],
],
];
];
return
$config
;
src/environments/prod/backend/web/index-test.php
0 → 100644
View file @
dd751d5d
<?php
// NOTE: Make sure this file is not accessible when deployed to production
if
(
!
in_array
(
@
$_SERVER
[
'REMOTE_ADDR'
],
[
'127.0.0.1'
,
'::1'
]))
{
die
(
'You are not allowed to access this file.'
);
}
if
(
!
function_exists
(
'fnmatch'
))
{
function
fnmatch
(
$pattern
,
$string
)
{
return
preg_match
(
"#^"
.
strtr
(
preg_quote
(
$pattern
,
'#'
),
array
(
'\*'
=>
'.*'
,
'\?'
=>
'.'
))
.
"$#i"
,
$string
);
}
// end
}
// end if
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
require
(
__DIR__
.
'/../config/bootstrap.php'
);
$config
=
require
(
__DIR__
.
'/../../tests/codeception/config/backend/acceptance.php'
);
(
new
yii\web\Application
(
$config
))
->
run
();
src/environments/prod/backend/web/index.php
View file @
dd751d5d
<?php
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'dev'
);
if
(
!
function_exists
(
'fnmatch'
))
{
function
fnmatch
(
$pattern
,
$string
)
{
return
preg_match
(
"#^"
.
strtr
(
preg_quote
(
$pattern
,
'#'
),
array
(
'\*'
=>
'.*'
,
'\?'
=>
'.'
))
.
"$#i"
,
$string
);
}
// end
}
// end if
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
...
...
src/environments/prod/common/config/main-local.php
View file @
dd751d5d
<?php
<?php
return
[
return
[
'components'
=>
[
'components'
=>
[
'cache'
=>
[
'class'
=>
'yii\redis\Cache'
,
'redis'
=>
[
'hostname'
=>
'192.168.1.12'
,
'port'
=>
6380
,
'database'
=>
2
,
]
],
'db'
=>
[
'db'
=>
[
'class'
=>
'yii\db\Connection'
,
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=
localhost;dbname=yii2advanced
'
,
'dsn'
=>
'mysql:host=
192.168.1.7;port:3305;dbname=pp_c
'
,
'username'
=>
'
root
'
,
'username'
=>
'
pp_c
'
,
'password'
=>
''
,
'password'
=>
'
nF@V5LK#ilb!NEvZ@1Ze#rWm#H
'
,
'charset'
=>
'utf8'
,
'charset'
=>
'utf8'
,
],
],
'redis'
=>
[
'class'
=>
'yii\redis\Connection'
,
'hostname'
=>
'192.168.1.21'
,
'port'
=>
6380
,
'database'
=>
2
,
],
'mailer'
=>
[
'mailer'
=>
[
'class'
=>
'yii\swiftmailer\Mailer'
,
'class'
=>
'yii\swiftmailer\Mailer'
,
'viewPath'
=>
'@common/mail'
,
'viewPath'
=>
'@common/mail'
,
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport'
=>
TRUE
,
],
],
'qiniu'
=>
[
'class'
=>
'common\components\Qiniu'
,
'accessKey'
=>
'n85SCPB9uO2v32az-3TRFsZCXwJu7YddyzLRYXg-'
,
'secretKey'
=>
'KDl3b7aLpj7n9YZ07lHGivVY4c_Q-0QSM0TZ_-XS'
,
'storages'
=>
[
'public'
=>
[
'bucket'
=>
'pp-classroom'
,
'fsizeLimit'
=>
pow
(
1024
,
2
)
*
5
,
//5MB
'mimeLimit'
=>
'image/jpeg;image/png;image/gif'
,
'url'
=>
'http://dev.qdn.pp.cc/'
],
'video'
=>
[
'bucket'
=>
'pp-classroom-private'
,
'fsizeLimit'
=>
pow
(
1024
,
3
)
*
2
,
//2GB
'mimeLimit'
=>
'video/*;flv-application/octet-stream'
,
'url'
=>
'http://oe9d6dr84.bkt.clouddn.com/'
]
]
]
],
],
];
];
src/environments/prod/common/config/params-local.php
View file @
dd751d5d
<?php
<?php
return
[
return
[
'adminEmail'
=>
'admin@example.com'
,
'supportEmail'
=>
'support@example.com'
,
'user.passwordResetTokenExpire'
=>
3600
,
'captchaId'
=>
'4d6ad870bf63a30be3d22c92925b04ca'
,
'privateKey'
=>
'a2ca5e5139d1f43ac4e1cd248f3e52e4'
,
'msg.host'
=>
'http://114.55.132.75:7893/sms.aspx'
,
'msg.userid'
=>
'78'
,
'msg.account'
=>
'276147613x'
,
'msg.password'
=>
'276147613'
,
'msg.signature'
=>
'【最课堂】'
,
'alipay'
=>
[
'partner'
=>
'2088701843067550'
,
'seller_id'
=>
'2088701843067550'
,
'key'
=>
'12vr33u4g314hytde3g81oao9dfdarm6'
,
'notify_url'
=>
'http://c.pp.cc/pay/alipay-notify'
,
'return_url'
=>
'http://商户网址/create_direct_pay_by_user-PHP-UTF-8/return_url.php'
,
'sign_type'
=>
strtoupper
(
'MD5'
),
'input_charset'
=>
strtolower
(
'utf-8'
),
'cacert'
=>
getcwd
()
.
'\\cacert.pem'
,
'transport'
=>
'http'
,
'payment_type'
=>
'1'
,
'service'
=>
'create_direct_pay_by_user'
,
],
// 'weixinpay'=>[
// 'appid'=>'wx180521eb22e9d7af',
// 'mchid'=>'1295461001',
// 'key'=>'ejg0l9phOAkp021qB54shz0Q8Tiscwzy',
// 'appsecret'=>'f20293c9548c469fb8b855fc98c4ef3c',
//
// ]
'weixinpay'
=>
[
'appid'
=>
'wx5714a24a60083b2a'
,
'mchid'
=>
'1399794002'
,
'key'
=>
'8934e7d15453e97507ef794cf7b0519d'
,
'appsecret'
=>
'7c18222c6ec31efa65d21606a629585d'
,
]
];
];
src/environments/prod/console/config/main-local.php
View file @
dd751d5d
<?php
<?php
return
[
return
[
];
];
src/environments/prod/frontend/config/main-local.php
View file @
dd751d5d
<?php
<?php
return
[
$config
=
[
'components'
=>
[
'components'
=>
[
'request'
=>
[
'request'
=>
[
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey'
=>
'1o1zEUf8jdBvsnZy_JygPUO5_sZ7zBci'
,
'cookieValidationKey'
=>
''
,
],
'session'
=>
[
'timeout'
=>
3600
,
'name'
=>
'zuiektang-frontend'
,
'class'
=>
'yii\redis\Session'
,
'redis'
=>
[
'hostname'
=>
'192.168.1.21'
,
'port'
=>
6380
,
'database'
=>
2
,
]
],
],
],
],
];
];
return
$config
;
src/environments/prod/frontend/web/index-test.php
0 → 100644
View file @
dd751d5d
<?php
// NOTE: Make sure this file is not accessible when deployed to production
if
(
!
in_array
(
@
$_SERVER
[
'REMOTE_ADDR'
],
[
'127.0.0.1'
,
'::1'
]))
{
die
(
'You are not allowed to access this file.'
);
}
if
(
!
function_exists
(
'fnmatch'
))
{
function
fnmatch
(
$pattern
,
$string
)
{
return
preg_match
(
"#^"
.
strtr
(
preg_quote
(
$pattern
,
'#'
),
array
(
'\*'
=>
'.*'
,
'\?'
=>
'.'
))
.
"$#i"
,
$string
);
}
// end
}
// end if
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
require
(
__DIR__
.
'/../config/bootstrap.php'
);
$config
=
require
(
__DIR__
.
'/../../tests/codeception/config/frontend/acceptance.php'
);
(
new
yii\web\Application
(
$config
))
->
run
();
src/environments/prod/frontend/web/index.php
View file @
dd751d5d
<?php
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
if
(
!
function_exists
(
'fnmatch'
))
{
function
fnmatch
(
$pattern
,
$string
)
{
return
preg_match
(
"#^"
.
strtr
(
preg_quote
(
$pattern
,
'#'
),
array
(
'\*'
=>
'.*'
,
'\?'
=>
'.'
))
.
"$#i"
,
$string
);
}
// end
}
// end if
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
require
(
__DIR__
.
'/../../common/config/bootstrap.php'
);
...
...
src/frontend/assets/AppAsset.php
View file @
dd751d5d
...
@@ -21,7 +21,8 @@ class AppAsset extends AssetBundle
...
@@ -21,7 +21,8 @@ class AppAsset extends AssetBundle
];
];
public
$depends
=
[
public
$depends
=
[
'yii\bootstrap\BootstrapAsset'
'yii\bootstrap\BootstrapAsset'
,
'yii\bootstrap\BootstrapPluginAsset'
];
];
//定义按需加载JS方法,注意加载顺序在最后
//定义按需加载JS方法,注意加载顺序在最后
...
...
src/frontend/controllers/ClassesInfoController.php
View file @
dd751d5d
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
namespace
frontend\controllers
;
namespace
frontend\controllers
;
use
common\models\Classes
;
use
common\models\Classes
;
use
common\models\Course
;
use
common\models\Income
;
use
frontend\components\ClassesFilter
;
use
frontend\components\ClassesFilter
;
use
Yii
;
use
Yii
;
use
yii\filters\AccessControl
;
use
yii\filters\AccessControl
;
...
@@ -36,10 +38,29 @@ class ClassesInfoController extends \yii\web\Controller
...
@@ -36,10 +38,29 @@ class ClassesInfoController extends \yii\web\Controller
];
];
}
}
/**
* 课堂概况
* @return string
*/
public
function
actionIndex
()
public
function
actionIndex
()
{
{
$uid
=
Yii
::
$app
->
user
->
getId
();
//课堂信息
$model
=
Classes
::
findOne
(
$this
->
classStatus
[
'id'
]);
$model
=
Classes
::
findOne
(
$this
->
classStatus
[
'id'
]);
return
$this
->
render
(
'index'
,
compact
(
'model'
));
//统计课程数量
$courseCount
=
Course
::
countCourseByUserId
(
$uid
);
//统计今日收
$timeBetween
=
strtotime
(
'Today'
);
$timeAnd
=
strtotime
(
'Tomorrow'
)
-
1
;
$todayIncome
=
Income
::
getMoneyTotalByTime
(
$uid
,
$timeBetween
,
$timeAnd
);
//统计评论数量
$commentCount
=
Course
::
countCommentsByUserId
(
$uid
);
return
$this
->
render
(
'index'
,
compact
(
'model'
,
'courseCount'
,
'todayIncome'
,
'commentCount'
));
}
}
/**
/**
...
@@ -60,9 +81,7 @@ class ClassesInfoController extends \yii\web\Controller
...
@@ -60,9 +81,7 @@ class ClassesInfoController extends \yii\web\Controller
}
else
{
}
else
{
$agreement
=
1
;
$agreement
=
1
;
}
}
echo
$model
->
status
;
if
(
Yii
::
$app
->
request
->
getIsPost
())
{
if
(
Yii
::
$app
->
request
->
getIsPost
())
{
$model
->
load
(
Yii
::
$app
->
request
->
post
());
$model
->
load
(
Yii
::
$app
->
request
->
post
());
$model
->
user_id
=
Yii
::
$app
->
user
->
getId
();
$model
->
user_id
=
Yii
::
$app
->
user
->
getId
();
...
...
src/frontend/controllers/HomeController.php
View file @
dd751d5d
...
@@ -36,11 +36,11 @@ class HomeController extends \yii\web\Controller
...
@@ -36,11 +36,11 @@ class HomeController extends \yii\web\Controller
//权限限制
//权限限制
'access'
=>
[
'access'
=>
[
'class'
=>
AccessControl
::
className
(),
'class'
=>
AccessControl
::
className
(),
'only'
=>
[
'support'
,
'favorite'
,
'comments'
,
'pay'
],
'only'
=>
[
'support'
,
'favorite'
,
'comments'
,
'pay'
,
'weixin-pay'
,
'browse-record'
,
'weixin-pay-qrcode'
],
'rules'
=>
[
'rules'
=>
[
[
[
'allow'
=>
TRUE
,
'allow'
=>
TRUE
,
'actions'
=>
[
'support'
,
'favorite'
,
'pay'
],
'actions'
=>
[
'support'
,
'favorite'
,
'pay'
,
'weixin-pay'
,
'browse-record'
,
'weixin-pay-qrcode'
],
'roles'
=>
[
'@'
],
'roles'
=>
[
'@'
],
],
],
[
[
...
@@ -142,9 +142,10 @@ class HomeController extends \yii\web\Controller
...
@@ -142,9 +142,10 @@ class HomeController extends \yii\web\Controller
if
(
!
Yii
::
$app
->
user
->
isGuest
)
{
if
(
!
Yii
::
$app
->
user
->
isGuest
)
{
$coursewareInfo
[
'userAvatar'
]
=
User
::
getAvatarUrl
(
Yii
::
$app
->
user
->
identity
->
avatar
);
$coursewareInfo
[
'userAvatar'
]
=
User
::
getAvatarUrl
(
Yii
::
$app
->
user
->
identity
->
avatar
);
}
}
$coursewareInfo
[
'price'
]
=
$course
->
price
;
$coursewareInfo
[
'classId'
]
=
$course
->
class_id
;
$coursewareInfo
[
'classId'
]
=
$course
->
class_id
;
$coursewareInfo
[
'className'
]
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
])
->
name
;
$coursewareInfo
[
'className'
]
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
])
->
name
;
return
$this
->
render
(
'video'
,
[
return
$this
->
render
(
'video'
,
[
'coursewareInfo'
=>
$coursewareInfo
'coursewareInfo'
=>
$coursewareInfo
]);
]);
...
...
src/frontend/controllers/MyIncomeController.php
View file @
dd751d5d
...
@@ -3,21 +3,48 @@
...
@@ -3,21 +3,48 @@
namespace
frontend\controllers
;
namespace
frontend\controllers
;
use
common\models\Income
;
use
common\models\Income
;
use
frontend\components\ClassesFilter
;
use
Yii
;
use
Yii
;
use
yii\filters\AccessControl
;
class
MyIncomeController
extends
\yii\web\Controller
class
MyIncomeController
extends
\yii\web\Controller
{
{
public
$layout
=
'classCenter'
;
public
$layout
=
'classCenter'
;
/**
* @inheritdoc
*/
public
function
behaviors
()
{
return
[
'access'
=>
[
'class'
=>
AccessControl
::
className
(),
//'only' => ['index', 'publish', 'submit'],
'rules'
=>
[
[
'allow'
=>
true
,
'roles'
=>
[
'@'
]
]
]
],
'classes'
=>
ClassesFilter
::
className
()
];
}
/**
/**
* 售课记录
* 售课记录
* @return string
* @return string
*/
*/
public
function
actionIndex
()
public
function
actionIndex
()
{
{
$ret
=
Income
::
getIncomeListByUserId
(
Yii
::
$app
->
user
->
getId
(),
null
,
20
);
$uid
=
Yii
::
$app
->
user
->
getId
();
return
$this
->
render
(
'index'
,
$ret
);
$ret
=
Income
::
getIncomeListByUserId
(
$uid
,
null
,
20
);
$settled
=
Income
::
getMoneyTotal
(
$uid
,
Income
::
STATUS_IS_SETTLED
);
$notSettled
=
Income
::
getMoneyTotal
(
$uid
,
Income
::
STATUS_NOT_SETTLED
);
return
$this
->
render
(
'index'
,
$ret
+
compact
(
'settled'
,
'notSettled'
));
}
}
}
}
src/frontend/controllers/MyMemberController.php
View file @
dd751d5d
...
@@ -4,6 +4,9 @@ namespace frontend\controllers;
...
@@ -4,6 +4,9 @@ namespace frontend\controllers;
class
MyMemberController
extends
\yii\web\Controller
class
MyMemberController
extends
\yii\web\Controller
{
{
public
$layout
=
'classCenter'
;
public
function
actionIndex
()
public
function
actionIndex
()
{
{
return
$this
->
render
(
'index'
);
return
$this
->
render
(
'index'
);
...
...
src/frontend/controllers/QiniuCallbackController.php
View file @
dd751d5d
...
@@ -31,9 +31,10 @@ class QiniuCallbackController extends \yii\web\Controller
...
@@ -31,9 +31,10 @@ class QiniuCallbackController extends \yii\web\Controller
//验证回调请求
//验证回调请求
$requestBody
=
file_get_contents
(
'php://input'
);
$requestBody
=
file_get_contents
(
'php://input'
);
$authorization
=
isset
(
$_SERVER
[
'HTTP_AUTHORIZATION'
])
?
$_SERVER
[
'HTTP_AUTHORIZATION'
]
:
''
;
$authorization
=
isset
(
$_SERVER
[
'HTTP_AUTHORIZATION'
])
?
$_SERVER
[
'HTTP_AUTHORIZATION'
]
:
''
;
$currentUrl
=
Yii
::
$app
->
request
->
hostInfo
.
Yii
::
$app
->
request
->
getUrl
();
$currentUrl
=
'http://t.pp.cc/tmp/qiniu_callback.php'
;
$currentUrl
=
YII_ENV
==
'dev'
?
'http://t.pp.cc/tmp/qiniu_callback.php'
:
Yii
::
$app
->
request
->
hostInfo
.
Yii
::
$app
->
request
->
getUrl
();
if
(
!
$auth
->
verifyCallback
(
$_SERVER
[
'CONTENT_TYPE'
],
$authorization
,
$currentUrl
,
$requestBody
))
{
if
(
!
$auth
->
verifyCallback
(
$_SERVER
[
'CONTENT_TYPE'
],
$authorization
,
$currentUrl
,
$requestBody
))
{
return
[
'error'
=>
'回调验证失败!'
];
return
[
'error'
=>
'回调验证失败!'
];
...
...
src/frontend/views/classes-info/index.php
View file @
dd751d5d
...
@@ -2,26 +2,31 @@
...
@@ -2,26 +2,31 @@
/**
/**
* @var $this yii\web\View
* @var $this yii\web\View
* @var \common\models\Classes $model
* @var \common\models\Classes $model
* @var $courseCount int
* @var $todayIncome float
* @var $commentCount int
*/
*/
use
yii\helpers\Url
;
$this
->
title
=
'我的课堂'
;
$this
->
title
=
'我的课堂'
;
?>
?>
<div
class=
"class-name"
>
<?=
$model
->
name
?>
</div>
<div
class=
"class-name"
>
<?=
$model
->
name
?>
</div>
<div
class=
"class-intro"
>
<div
class=
"class-intro"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h3>
课程总数
</h3>
<h3>
课程总数
</h3>
<p>
10
<small>
讲
</small></p>
<p>
<?=
$courseCount
?>
<small>
讲
</small></p>
<a
href=
"
#
"
>
发布课程
</a>
<a
href=
"
<?=
Url
::
to
([
'my-course/publish'
])
?>
"
>
发布课程
</a>
<i
class=
"icon-play"
></i>
<i
class=
"icon-play"
></i>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h3>
今日收益
</h3>
<h3>
今日收益
</h3>
<p>
192.00
<small>
元
</small></p>
<p>
<?=
$todayIncome
?>
<small>
元
</small></p>
<a
href=
"
#
"
>
查看账单
</a>
<a
href=
"
<?=
Url
::
to
([
'my-income/index'
])
?>
"
>
查看账单
</a>
<i
class=
"icon-clipboard"
></i>
<i
class=
"icon-clipboard"
></i>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h3>
今日发言
</h3>
<h3>
今日发言
</h3>
<p>
891
<small>
条
</small></p>
<p>
<?=
$commentCount
?>
<small>
条
</small></p>
<i
class=
"icon-speech-bubble"
></i>
<i
class=
"icon-speech-bubble"
></i>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/frontend/views/home/video.php
View file @
dd751d5d
...
@@ -6,6 +6,24 @@
...
@@ -6,6 +6,24 @@
* Time: 下午5:39
* Time: 下午5:39
*/
*/
$this
->
title
=
"视频播放"
;
$this
->
title
=
"视频播放"
;
\backend\assets\AppAsset
::
register
(
$this
);
$js
=
<<<JS
window._bd_share_config = {
"common": {
"bdSnsKey": {},
"bdText": "",
"bdMini": "1",
"bdMiniList": ["qzone", "tsina", "weixin"],
"bdPic": "",
"bdStyle": "2",
"bdSize": "24"
}, "share": {}
};
with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
JS;
$this
->
registerJs
(
$js
);
\frontend\assets\AppAsset
::
addCss
(
$this
,
'@web/assets/css/main.css'
);
\frontend\assets\AppAsset
::
addCss
(
$this
,
'@web/assets/css/main.css'
);
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/home_video.js'
);
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/home_video.js'
);
\frontend\assets\AppAsset
::
addCss
(
$this
,
'@web/assets/css/home_video.css'
);
\frontend\assets\AppAsset
::
addCss
(
$this
,
'@web/assets/css/home_video.css'
);
...
...
src/frontend/views/layouts/classCenter.php
View file @
dd751d5d
...
@@ -33,7 +33,7 @@ $this->beginContent('@app/views/layouts/center.php');
...
@@ -33,7 +33,7 @@ $this->beginContent('@app/views/layouts/center.php');
<li>
<li>
<div
class=
"link"
><i
class=
"icon-fingerprint"
></i>
我的会员
<i
class=
"icon-navigate_next"
></i></div>
<div
class=
"link"
><i
class=
"icon-fingerprint"
></i>
我的会员
<i
class=
"icon-navigate_next"
></i></div>
<ul
class=
"submenu"
>
<ul
class=
"submenu"
>
<li><a
href=
"
#
"
>
会员列表
</a></li>
<li><a
href=
"
/my-member
"
>
会员列表
</a></li>
</ul>
</ul>
</li>
</li>
<li>
<li>
...
...
src/frontend/views/my-course/index.php
View file @
dd751d5d
...
@@ -36,4 +36,7 @@ $qiniu = \Yii::$app->qiniu;
...
@@ -36,4 +36,7 @@ $qiniu = \Yii::$app->qiniu;
</div>
</div>
<?php
}
?>
<?php
}
?>
</div>
</div>
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
\ No newline at end of file
<div
class=
"text-center"
>
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
</div>
src/frontend/views/my-income/index.php
View file @
dd751d5d
...
@@ -10,11 +10,11 @@ $this->title = '知识有价';
...
@@ -10,11 +10,11 @@ $this->title = '知识有价';
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h3>
已结算
</h3>
<h3>
已结算
</h3>
<p>
¥
162.03
</p>
<p>
¥
<?=
$settled
?>
</p>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h3>
待结算
</h3>
<h3>
待结算
</h3>
<p>
¥
1829.00
</p>
<p>
¥
<?=
$notSettled
?>
</p>
</div>
</div>
</div>
</div>
...
...
src/frontend/views/my-member/index.php
View file @
dd751d5d
<?php
<?php
/* @var $this yii\web\View */
/* @var $this yii\web\View */
?>
?>
<h1>
my-member/index
</h1>
<div
class=
"vip-top clearfix"
>
<div
class=
"col-md-6"
>
<div
class=
"reg-vip-box"
>
<b>
47
</b>
<span>
全部会员
</span>
<i
class=
"icon-verified_user"
></i>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"money-vip-box"
>
<b>
23
</b>
<span>
付费会员
</span>
<i
class=
"icon-heart"
></i>
</div>
</div>
</div>
<p>
<div
class=
"con-md-12"
>
You may change the content of this page by modifying
<div
class=
"table-responsive table-box"
>
the file
<code>
<?=
__FILE__
;
?>
</code>
.
<table
class=
"table table-hover"
>
</p>
<thead>
<tr>
<th>
注册时间
</th>
<th>
会员信息
</th>
<th>
来自
</th>
<th>
首次购买
</th>
<th>
累计消费
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
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>
</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>
</div>
</div>
</div>
\ No newline at end of file
src/frontend/web/js/home/components/video-play.vue
View file @
dd751d5d
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"cnt-tit"
>
<div
class=
"cnt-tit"
>
<h3>
{{
coursewareInfo
.
courseName
}}
</h3>
<h3>
{{
coursewareInfo
.
courseName
}}
</h3>
<div
class=
"tit-share hidden-xs"
>
<div
class=
"tit-share hidden-xs
bdsharebuttonbox
"
>
<a
href=
"javascript:;"
class=
"wechat post-icons"
></a>
<a
href=
"javascript:;"
class=
"wechat post-icons
bds_weixin"
data-cmd=
"weixin"
title=
"分享到微信
"
></a>
<a
href=
"javascript:;"
class=
"weibo post-icons"
></a>
<a
href=
"javascript:;"
class=
"weibo post-icons
bds_tsina"
data-cmd=
"tsina"
title=
"分享到新浪微博
"
></a>
<a
href=
"javascript:;"
class=
"qzone post-icons"
></a>
<a
href=
"javascript:;"
class=
"qzone post-icons
bds_qzone"
data-cmd=
"qzone"
title=
"分享到QQ空间
"
></a>
</div>
</div>
</div>
</div>
...
@@ -17,20 +17,81 @@
...
@@ -17,20 +17,81 @@
</div>
</div>
<div
class=
"video-detail-info"
>
<div
class=
"video-detail-info"
>
<div
v-for=
"
item
in coursewareInfo.teachers"
class=
"video-teacher"
>
<div
v-for=
"
(index,item)
in coursewareInfo.teachers"
class=
"video-teacher"
>
<a
href=
"javascript:;"
data-toggle=
"modal"
data-target=
"#myModal2
"
><img
<a
data-toggle=
"modal"
data-target=
"
{{
{
'#teacherInfo'
+
index
}}
}
"><img
:src="
getFullPic
(
item
.
avatar
)
"></a>
:src="
getFullPic
(
item
.
avatar
)
"></a>
<p><a href="
javascript
:;
" data-toggle="
modal
" data-target="
#
myModal2
">{{item.name
}}
</a></p>
<p><a href="
javascript
:;
" data-toggle="
modal
" data-target="
#
myModal2
">{{item.name
}}
</a></p>
</div>
</div>
<div
class=
"video-sm-info"
>
<div class="
video
-
sm
-
info
pull
-
left
">
<a href="
javascript
:;
"><i class="
icon
-
comment
-
empty
"></i>{{coursewareInfo.comment_count
}}
</a>
<a href="
javascript
:;
"><i class="
icon
-
comment
-
empty
"></i>{{coursewareInfo.comment_count
}}
</a>
<a @click="
favorite
" href="
javascript
:;
"><i
<a @click="
favorite
" href="
javascript
:;
"><i
:class="
{
'icon-fav-full'
:
coursewareInfo
.
isFavorite
,
'icon-fav-empty'
:
!
coursewareInfo
.
isFavorite
}
"></i>{{coursewareInfo.favorite_count
}}
</a>
:class="
{
'icon-fav-full'
:
coursewareInfo
.
isFavorite
,
'icon-fav-empty'
:
!
coursewareInfo
.
isFavorite
}
"></i>{{coursewareInfo.favorite_count
}}
</a>
<a @click="
support
" href="
javascript
:;
"><i
<a @click="
support
" href="
javascript
:;
"><i
:class="
{
'icon-zan-full'
:
coursewareInfo
.
isSupport
,
'icon-zan-empty'
:
!
coursewareInfo
.
isSupport
}
"></i>{{coursewareInfo.support_count
}}
</a>
:class="
{
'icon-zan-full'
:
coursewareInfo
.
isSupport
,
'icon-zan-empty'
:
!
coursewareInfo
.
isSupport
}
"></i>{{coursewareInfo.support_count
}}
</a>
<button v-if="
coursewareInfo
.
isGuest
" @click="
login
" class="
btn
btn
-
danger
m
-
l
-
20
hidden
-
xs
">购买
¥{{coursewareInfo.price
}}
</button>
<button v-else class="
btn
btn
-
danger
m
-
l
-
20
hidden
-
xs
" data-toggle="
modal
"
data-target="
#
pay
">购买 ¥{{coursewareInfo.price
}}
</button>
</div>
</div>
</div>
<div v-if="
!
coursewareInfo
.
isGuest
" class="
modal
fade
" id="
pay
" tabindex="
-
1
" role="
dialog
"
aria-labelledby="
myModalLabel
" aria-hidden="
true
">
<div class="
modal
-
dialog
modal
-
sm
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<button type="
button
" class="
close
" data-dismiss="
modal
"><span
aria-hidden="
true
">×</span><span class="
sr
-
only
">Close</span></button>
<h4 class="
modal
-
title
" id="
myModalLabel
">在线支付</h4>
</div>
<div class="
modal
-
body
">
<div class="
pay
-
style
">
<h3>¥{{coursewareInfo.price
}}
</h3>
<button data-dismiss="
modal
" @click="
alipay
(
coursewareInfo
.
course_id
)
" class="
btn
btn
-
alipay
">支付宝支付</button>
<button @click="
showQrcode
=
true
" class="
btn
btn
-
wecat
">微信支付</button>
</div>
</div>
</div>
<div v-show="
showQrcode
" class="
wecat
-
qrcode
">
<div class="
top
-
back
-
a
">
<a href="
javascript
:;
" @click="
showQrcode
=
false
">< 返回支付渠道选择</a>
</div>
<div class="
qrcode
-
img
">
<img :src="
getWeixinPayQrcode
(
coursewareInfo
.
course_id
)
">
<p>请使用微信扫一扫付款</p>
</div>
</div>
</div>
</div>
<div v-for="
(
index
,
item
)
in
coursewareInfo
.
teachers
" class="
modal
fade
" id="
{{{
'teacherInfo'
+
index
}}
}
" tabindex="
-
1
"
role="
dialog
" aria-labelledby="
myModalLabel
" aria-hidden="
true
">
<div class="
modal
-
dialog
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<button type="
button
" class="
close
" data-dismiss="
modal
"><span
aria-hidden="
true
">×</span><span class="
sr
-
only
">Close</span></button>
<h4 class="
modal
-
title
">讲师信息</h4>
</div>
<div class="
modal
-
body
">
<div class="
teacher
-
info
text
-
center
">
<img :src="
getFullPic
(
item
.
avatar
)
">
<h3>{{item.name
}}
</h3>
<p class="
teacher
-
detail
">
{{item.intro
}}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<script>
<script>
...
@@ -43,9 +104,35 @@
...
@@ -43,9 +104,35 @@
export default{
export default{
data(){
data(){
return
{}
return {
showQrcode: false
}
}
,
}
,
methods: {
methods: {
getWeixinPayQrcode(courseId){
return __BASE_URL__ + 'home/weixin-pay-qrcode?courseId=' + courseId;
}
,
alipay(courseId){
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
window.open(url);
layer.confirm('是否已经完成支付?', {
btn: ['是的', '没有'] //按钮
}
, function () {
window.location.reload();
}
, function () {
}
);
}
,
login(){
var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id;
var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl;
$.getJSON(url, function () {
window.location.href = __BASE_URL__ + 'site/login';
}
).error(function () {
layer.alert('设置登录回调url错误', {'icon': 2, 'title': '提示'
}
)
}
);
}
,
favorite(){
favorite(){
if (this.coursewareInfo.isGuest != true) {
if (this.coursewareInfo.isGuest != true) {
var self = this;
var self = this;
...
@@ -109,3 +196,4 @@
...
@@ -109,3 +196,4 @@
}
}
}
}
</script>
</script>
src/frontend/web/js/home/video.js
View file @
dd751d5d
...
@@ -23,16 +23,18 @@ $("#main-login").attr('href', 'javascript:;').click(function () {
...
@@ -23,16 +23,18 @@ $("#main-login").attr('href', 'javascript:;').click(function () {
});
});
if
(
!
coursewareInfo
.
isGuest
){
//记录浏览记录
//记录浏览记录
var
url
=
__BASE_URL__
+
'home/browse-record?coursewareId='
+
coursewareInfo
.
id
;
var
url
=
__BASE_URL__
+
'home/browse-record?coursewareId='
+
coursewareInfo
.
id
;
$
.
getJSON
(
url
,
function
(
response
)
{
$
.
getJSON
(
url
,
function
(
response
)
{
if
(
response
.
status
===
false
)
{
if
(
response
.
status
===
false
)
{
layer
.
alert
(
'浏览记录添加逻辑错误'
,
{
'icon'
:
2
,
'title'
:
'提示'
})
layer
.
alert
(
'浏览记录添加逻辑错误'
,
{
'icon'
:
2
,
'title'
:
'提示'
})
}
}
}).
error
(
function
()
{
}).
error
(
function
()
{
layer
.
alert
(
'添加浏览记录错误'
,
{
'icon'
:
2
,
'title'
:
'提示'
})
layer
.
alert
(
'添加浏览记录错误'
,
{
'icon'
:
2
,
'title'
:
'提示'
})
});
});
}
var
href
=
$
(
'#main-sign'
).
attr
(
"href"
);
var
href
=
$
(
'#main-sign'
).
attr
(
"href"
);
$
(
'#main-sign'
).
attr
(
'href'
,
href
+
'?from='
+
coursewareInfo
.
user_id
);
$
(
'#main-sign'
).
attr
(
'href'
,
href
+
'?from='
+
coursewareInfo
.
user_id
);
...
...
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