Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
7a377db9
Commit
7a377db9
authored
Oct 09, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz
parents
10806b39
78d23518
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
17 deletions
+65
-17
Message.php
application/controllers/Message.php
+1
-1
Store.php
application/controllers/Store.php
+2
-2
Push.php
application/library/Our/Push.php
+2
-1
GoodsBrowse.php
application/models/DAO/GoodsBrowse.php
+0
-5
test.php
public/test.php
+60
-8
No files found.
application/controllers/Message.php
View file @
7a377db9
...
...
@@ -135,7 +135,7 @@ class MessageController extends \Our\Controller_AbstractApi {
public
function
getUnreadCountAction
(){
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
();
$unreadCount
=
$messageService
->
getUnreadCountByMemberIdAndType
(
$this
->
memberId
);
$this
->
success
(
array
(
'unreadCount'
=>
$unreadCount
));
$this
->
success
(
array
(
'unreadCount'
=>
(
int
)
$unreadCount
));
}
public
function
setAction
(){
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
();
...
...
application/controllers/Store.php
View file @
7a377db9
...
...
@@ -10,10 +10,10 @@ class StoreController extends \Our\Controller_AbstractIndex {
$this
->
memberId
=
$this
->
sess
->
get
(
'member_id'
);
}
/**
* 获取店铺首页头部
(公用)
* 获取店铺首页头部
*/
public
function
getStoreInfoAction
(){
$address
=
\Business\User\AddressServiceModel
::
getInstance
()
->
getMyAddress
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
);
$address
=
\Business\User\AddressServiceModel
::
getInstance
()
->
getMyAddress
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
,
false
);
$storeInfo
=
$this
->
storeService
->
getStoreInfo
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
,
$address
);
$storeInfo
[
'share'
]
=
\Business\Common\CommonServiceModel
::
getInstance
()
->
getShareInfo
(
\Our\ApiConst
::
shareStore
,
$this
->
req
[
\Our\NameConst
::
data
][
'storeId'
]);
$this
->
success
(
$storeInfo
);
...
...
application/library/Our/Push.php
View file @
7a377db9
...
...
@@ -191,7 +191,8 @@ class Push
}
public
function
getOrderMessageContent
(
$orderDetail
){
$messageContent
=
'商品名称:'
;
$messageContent
=
'订单号:'
.
$orderDetail
[
'orderSn'
]
.
"
\n
"
;
$messageContent
.=
'商品名称:'
;
foreach
(
$orderDetail
[
'orderGoods'
]
as
$orderGood
){
$messageContent
.=
$orderGood
[
'goodsName'
]
.
'×'
.
$orderGood
[
'goodsNum'
]
.
"
\n
"
;
}
...
...
application/models/DAO/GoodsBrowse.php
View file @
7a377db9
...
...
@@ -91,11 +91,6 @@ class GoodsBrowseModel extends \DAO\AbstractModel {
public
function
getDistinctDate
(
$member_id
,
$startTime
,
$endTime
,
$order
){
$this
->
setDb
();
$data
=
$this
->
db
->
select
(
'DISTINCT browsedate'
)
->
from
(
$this
->
_tableName
)
->
where
(
"member_id=
{
$member_id
}
"
)
->
where
(
"browsedate BETWEEN
{
$startTime
}
AND
{
$endTime
}
"
)
->
order
(
$order
[
0
],
$order
[
1
])
->
fetchAll
();
if
(
$data
)
{
foreach
(
$data
as
&
$v
)
{
$v
[
'browsedate'
]
=
(
int
)
$v
[
'browsedate'
];
}
}
return
$data
;
}
public
function
delete
(
$where
){
...
...
public/test.php
View file @
7a377db9
<?php
phpinfo
();
exit
;
$redis
=
new
Redis
();
$redis
->
connect
(
'127.0.0.1'
,
'6379'
);
$redis
->
rPush
(
'test'
,
0
);
$res
=
$redis
->
lPop
(
'test'
);
var_dump
(
$res
);
?>
$www_file
=
'/home/wwwroot/mysite/'
;
//打开网站目录下的hooks.log文件 需要在服务器上创建 并给写权限
$fs
=
fopen
(
$www_file
.
'hooks.log'
,
'a'
);
fwrite
(
$fs
,
'================ Update Start ==============='
.
PHP_EOL
.
PHP_EOL
);
//自定义字串掩码 用于验证
$access_token
=
's7kjjhh8767laq29KLJK9089883hjjkgfdrrpipoinmw'
;
//接受的ip数组,也就是允许哪些IP访问这个文件 这里是gitlab服务器IP
$access_ip
=
array
(
'8.8.8.8'
);
//获取请求端的ip和token
$client_token
=
$_GET
[
'token'
];
$client_ip
=
$_SERVER
[
'REMOTE_ADDR'
];
//把请求的IP和时间写进log
fwrite
(
$fs
,
'Request on ['
.
date
(
"Y-m-d H:i:s"
)
.
'] from ['
.
$client_ip
.
']'
.
PHP_EOL
);
//验证token 有错就写进日志并退出
if
(
$client_token
!==
$access_token
)
{
echo
"error 403"
;
fwrite
(
$fs
,
"Invalid token [
{
$client_token
}
]"
.
PHP_EOL
);
exit
(
0
);
}
//验证ip
if
(
!
in_array
(
$client_ip
,
$access_ip
))
{
echo
"error 503"
;
fwrite
(
$fs
,
"Invalid ip [
{
$client_ip
}
]"
.
PHP_EOL
);
exit
(
0
);
}
//获取请求端发送来的信息,具体格式参见gitlab的文档
$json
=
file_get_contents
(
'php://input'
);
$data
=
json_decode
(
$json
,
true
);
//如果有需要 可以打开下面,把传送过来的信息写进log
//fwrite($fs, 'Data: '.print_r($data, true).PHP_EOL);
//执行shell命令并把返回信息写进日志
$output
=
shell_exec
(
"cd
$www_file
&;&; git checkout master &;&; git pull origin master 2>&;1"
);
fwrite
(
$fs
,
'Info:'
.
$output
.
PHP_EOL
);
fwrite
(
$fs
,
PHP_EOL
.
'================ Update End ==============='
.
PHP_EOL
.
PHP_EOL
);
$fs
and
fclose
(
$fs
);
//网站目录$www_file='/home/wwwroot/mysite/';//打开网站目录下的hooks.log文件 需要在服务器上创建 并给写权限$fs = fopen($www_file.'hooks.log', 'a');fwrite($fs, '================ Update Start ==============='.PHP_EOL.PHP_EOL);//自定义字串掩码 用于验证$access_token = 's7kjjhh8767laq29KLJK9089883hjjkgfdrrpipoinmw';//接受的ip数组,也就是允许哪些IP访问这个文件 这里是gitlab服务器IP$access_ip = array('8.8.8.8');//获取请求端的ip和token$client_token = $_GET['token'];$client_ip = $_SERVER['REMOTE_ADDR'];//把请求的IP和时间写进logfwrite($fs, 'Request on ['.date("Y-m-d H:i:s").'] from ['.$client_ip.']'.PHP_EOL);//验证token 有错就写进日志并退出if ($client_token !== $access_token){echo "error 403";fwrite($fs, "Invalid token [{$client_token}]".PHP_EOL);exit(0);}//验证ipif ( !in_array($client_ip, $access_ip)){echo "error 503";fwrite($fs, "Invalid ip [{$client_ip}]".PHP_EOL);exit(0);}//获取请求端发送来的信息,具体格式参见gitlab的文档$json = file_get_contents('php://input');$data = json_decode($json, true);//如果有需要 可以打开下面,把传送过来的信息写进log//fwrite($fs, 'Data: '.print_r($data, true).PHP_EOL);//执行shell命令并把返回信息写进日志$output=shell_exec("cd $www_file &;&; git checkout master &;&; git pull origin master 2>&;1");fwrite($fs, 'Info:'. $output.PHP_EOL);fwrite($fs,PHP_EOL. '================ Update End ==============='.PHP_EOL.PHP_EOL);$fs and fclose($fs);
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