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
4a45cebc
Commit
4a45cebc
authored
Jan 15, 2019
by
chenchuanwen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ccw' of git.shenbd.com:qm-develop/shenbd into ccw
parents
f4c26d94
7dc8998f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
9 deletions
+78
-9
a.php
a.php
+1
-1
ApiConst.php
application/library/Our/ApiConst.php
+1
-1
ImageConst.php
application/library/Our/ImageConst.php
+3
-0
GoodsClassService.php
application/models/Business/Goods/GoodsClassService.php
+1
-2
StoreService.php
application/models/Business/Store/StoreService.php
+4
-3
application.ini
conf/application.ini
+2
-2
test.php
public/test.php
+66
-0
No files found.
a.php
View file @
4a45cebc
<?php
echo
1
;
exit
;
phpinfo
()
;
exit
;
header
(
"Content-type: text/html; charset=utf-8"
);
//利用PHP目录和文件函数遍历用户给出目录的所有的文件和文件夹,修改文件名称
function
fRename
(
$dirname
)
...
...
application/library/Our/ApiConst.php
View file @
4a45cebc
...
...
@@ -11,7 +11,7 @@ class ApiConst
const
randLengh
=
8
;
//10天数秒
const
tenDaySecond
=
864
000
;
const
tenDaySecond
=
2592
000
;
//const tenDaySecond = 300;
//一天
const
threeDaySecond
=
259200
;
...
...
application/library/Our/ImageConst.php
View file @
4a45cebc
...
...
@@ -20,6 +20,9 @@ class ImageConst{
//分类图标前缀
const
categoryPicPrefix
=
'category-pic-'
;
const
categoryHeadPicPrefix
=
'category-headpic-'
;
const
topClassAdvImagePrefis
=
'category-hdpic-'
;
//一级分类对应广告图前缀
//商家举报图片存放路径
...
...
application/models/Business/Goods/GoodsClassService.php
View file @
4a45cebc
...
...
@@ -55,6 +55,7 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
return
array
(
'totalCount'
=>
\Our\ApiConst
::
zero
);
}
}
/**
* 获取平台全部一级分类
* @param $where
...
...
@@ -65,7 +66,6 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
//验证参数
$addressDao
=
\DAO\AddressModel
::
getInstance
();
$validFlag
=
$addressDao
->
getValidAddress
(
$where
);
if
(
!
$validFlag
){
...
...
@@ -220,7 +220,6 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
if
(
!
(
$newStoreIds
&&
in_array
(
$signClass
[
'store_id'
],
$newStoreIds
))){
$newStoreIds
[]
=
$signClass
[
'store_id'
];
}
}
}
foreach
(
$returnClass
as
$key
=>
$class
){
...
...
application/models/Business/Store/StoreService.php
View file @
4a45cebc
...
...
@@ -826,11 +826,12 @@ class StoreServiceModel extends \Business\AbstractModel{
//$expressStores = $this->getExpressStores($gcId,$condition);
$goodsClassList
=
$goodsClassDao
->
getOnlineSecondClassList
(
$gcId
);
if
(
$goodsClassList
){
foreach
(
$goodsClassList
as
$goodsClass
){
$returnStores
=
array
();
$returnStores
[
'gcName'
]
=
htmlspecialchars_decode
(
$goodsClass
[
'gcName'
]);
//$returnStores['gcImg'] = \Our\Common::getStaticFile(\Our\ImageConst::categoryHeadPicPrefix.$goodsClass['gcId'].\Our\NameConst::jpgSuffix,\Our\ImageConst::defaultPath);
$returnStores
[
'gcImg'
]
=
\Our\Common
::
getStaticFile
(
'category-headpic-default.jpg'
,
\Our\ImageConst
::
defaultPath
);
$existStoreIds
=
null
;
$returnStores
[
'stores'
]
=
null
;
$exitStore
=
array
();
...
...
@@ -863,7 +864,6 @@ class StoreServiceModel extends \Business\AbstractModel{
$returnStores
[
'stores'
][]
=
$purchasedStore
;
}
}
if
(
$returnStores
[
'stores'
]){
foreach
(
$returnStores
[
'stores'
]
as
$key
=>
$tempStore
){
$tempDistance
[
$key
]
=
$tempStore
[
'storeDistance'
];
...
...
@@ -873,13 +873,14 @@ class StoreServiceModel extends \Business\AbstractModel{
}
}
if
(
$return
){
/*var_dump(json_encode($return));
$tempReturn = array();
foreach($return as $tempVal){
$distance = min(array_column($tempVal['stores'],'storeDistance'));
$tempReturn[$distance] = $tempVal;
}
ksort($tempReturn);
$return
=
array_values
(
$tempReturn
);
$return = array_values($tempReturn);
*/
return
$return
;
}
}
...
...
conf/application.ini
View file @
4a45cebc
...
...
@@ -392,7 +392,7 @@ elastic.master.scheme="http";
resources.database.params.driver
=
"pdo_mysql"
resources.database.params.hostname
=
"127.0.0.1"
resources.database.params.port
=
3306
resources.database.params.database
=
"
test
qmcs"
resources.database.params.database
=
"qmcs"
resources.database.params.username
=
"root"
resources.database.params.password
=
"123456"
resources.database.params.charset
=
"UTF8"
...
...
@@ -402,7 +402,7 @@ resources.database.params.driver_options.1002 = "SET NAMES utf8"
resources.database.slave.params.driver
=
"pdo_mysql"
resources.database.slave.params.hostname
=
"127.0.0.1"
resources.database.slave.params.port
=
3306
resources.database.slave.params.database
=
"
test
qmcs"
resources.database.slave.params.database
=
"qmcs"
resources.database.slave.params.username
=
"root"
resources.database.slave.params.password
=
"123456"
resources.database.slave.params.charset
=
"UTF8"
...
...
public/test.php
0 → 100644
View file @
4a45cebc
<?php
phpinfo
();
exit
;
echo
json_encode
(
$_SERVER
);
exit
;
$res
=
file_exists
(
'/www/web/testadmin_shenbd_com/public_html/data/upload/mall/avatar/member_avatar_26.jpg'
);
var_dump
(
$res
);
exit
;
$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