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
cfb7c0dd
Commit
cfb7c0dd
authored
Oct 08, 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
1681b9f1
637b4656
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
12 deletions
+60
-12
a.php
a.php
+35
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+2
-2
MessageService.php
application/models/Business/Message/MessageService.php
+1
-1
Order.php
application/models/DAO/Order/Order.php
+6
-2
index.php
public/index.php
+3
-0
storeMonthSales.php
scripts/crontab/store/storeMonthSales.php
+13
-6
No files found.
a.php
100755 → 100644
View file @
cfb7c0dd
<?php
echo
3333333
;
header
(
"Content-type: text/html; charset=utf-8"
);
//利用PHP目录和文件函数遍历用户给出目录的所有的文件和文件夹,修改文件名称
function
fRename
(
$dirname
)
{
if
(
!
is_dir
(
$dirname
))
{
echo
"
{
$dirname
}
不是一个有效的目录!"
;
exit
();
}
$handle
=
opendir
(
$dirname
);
$i
=
1
;
while
((
$fn
=
readdir
(
$handle
))
!==
false
)
{
if
(
$fn
!=
'.'
&&
$fn
!=
'..'
)
{
echo
"<br>将名为:"
.
$fn
.
"
\n\r
"
;
$curDir
=
$dirname
.
'/'
.
$fn
;
if
(
is_dir
(
$curDir
))
{
fRename
(
$curDir
);
}
else
{
$path
=
pathinfo
(
$curDir
);
if
(
empty
(
$path
[
'extension'
]))
{
//改成你自己想要的新名字
$newname
=
$path
[
'dirname'
]
.
'/'
.
$path
[
'basename'
]
.
'.jpg'
;
echo
"替换成:"
.
$i
.
'.'
.
$newname
.
"
\r\n
"
;
rename
(
$curDir
,
$newname
);
$i
++
;
}
}
}
}
}
//给出一个目录名称可以是相对路径,也可以是绝对路径
fRename
(
'/www/web/testadmin_shenbd_com/public_html/data/upload/mall/avatar_bak'
);
exit
();
application/models/Business/Goods/GoodsCommonService.php
View file @
cfb7c0dd
...
...
@@ -929,8 +929,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$orderDAO
=
\DAO\Order\OrderModel
::
getInstance
();
$goodsCommonDAO
=
\DAO\GoodsCommonModel
::
getInstance
();
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
$page
Size
=
1000
;
$page
Index
=
0
;
$page
Index
=
\Our\PageConst
::
taskPageBegin
;
$page
Size
=
\Our\PageConst
::
taskPageSize
;
$storeIds
=
$storeDAO
->
getOnlineStores
(
null
,
'store_id'
);
while
(
true
)
{
$limit
=
array
(
$pageIndex
*
$pageSize
,
$pageSize
);
...
...
application/models/Business/Message/MessageService.php
View file @
cfb7c0dd
...
...
@@ -247,10 +247,10 @@ class MessageServiceModel extends \Business\AbstractModel
{
$messageHistory
=
\DAO\MessageHistoryModel
::
getInstance
();
$self
=
$this
->
getUserByMemberIdAndSelfType
(
$memberId
,
$selfType
);
$toMember
=
$this
->
getUserByMemberIdAndSelfType
(
$toId
,
$toType
);
if
(
empty
(
$toId
))
{
$toId
=
$this
->
getMemberIdByOtherIdAndType
(
$otherId
,
$toType
);
}
$toMember
=
$this
->
getUserByMemberIdAndSelfType
(
$toId
,
$toType
);
$returnMemeber
[
'toId'
]
=
(
int
)
$toId
;
$returnMemeber
[
'toUserId'
]
=
(
int
)
$toMember
[
'uid'
];
$returnMemeber
[
'toUserName'
]
=
$toMember
[
'name'
];
...
...
application/models/DAO/Order/Order.php
View file @
cfb7c0dd
...
...
@@ -69,10 +69,14 @@ class OrderModel extends \DAO\AbstractModel
return
$this
->
db
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchNum
();
}
public
function
getCounts
(
$where
,
$field
,
$group
=
false
)
public
function
getCounts
(
$where
,
$field
,
$group
=
false
,
$limit
=
[]
)
{
$this
->
setDb
();
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
group
(
$group
)
->
fetchAll
();
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
group
(
$group
);
if
(
$limit
)
{
$this
->
db
->
limit
(
$limit
[
0
],
$limit
[
1
]);
}
return
$this
->
db
->
fetchAll
();
}
public
function
getOrderCounts
(
$where
,
$field
)
...
...
public/index.php
View file @
cfb7c0dd
...
...
@@ -17,3 +17,6 @@ if(APP_ENV=='test' || APP_ENV=='pre' ||APP_ENV=='ccwdevelop' || APP_ENV=='produc
}
$app
=
new
\Yaf\Application
(
APPLICATION_PATH
.
"/conf/application.ini"
,
APP_ENV
);
$app
->
bootstrap
()
->
run
();
scripts/crontab/store/storeMonthSales.php
100755 → 100644
View file @
cfb7c0dd
...
...
@@ -6,11 +6,18 @@
*/
define
(
"APPLICATION_PATH"
,
realpath
(
dirname
(
__FILE__
)
.
'/../../../'
));
//指向public的上一级
require
APPLICATION_PATH
.
'/scripts/crontab/common.php'
;
$data
=
\DAO\Order\OrderModel
::
getInstance
()
->
getCounts
(
'payment_time >= '
.
(
time
()
-
30
*
24
*
60
*
60
),
'count(order_id) as num,store_id'
,
'store_id'
);
$pageIndex
=
\Our\PageConst
::
taskPageBegin
;
$pageSize
=
\Our\PageConst
::
taskPageSize
;
do
{
$limit
=
array
(
$pageIndex
*
$pageSize
,
$pageSize
);
$data
=
\DAO\Order\OrderModel
::
getInstance
()
->
getCounts
(
'payment_time >= '
.
(
time
()
-
30
*
24
*
60
*
60
),
'count(order_id) as num,store_id'
,
'store_id'
,
$limit
);
//$data = \DAO\Order\OrderModel::getInstance()->getCounts('payment_time >= 1518303150','store_id,count(order_id) as num','store_id');
if
(
$data
){
foreach
(
$data
as
&
$v
){
$v
[
'updatetime'
]
=
time
();
if
(
$data
){
foreach
(
$data
as
&
$v
){
$v
[
'updatetime'
]
=
time
();
}
\DAO\StoreMonthSalesModel
::
getInstance
()
->
insertAllOrUpdate
(
$data
);
}
\DAO\StoreMonthSalesModel
::
getInstance
()
->
insertAllOrUpdate
(
$data
);
}
$pageIndex
++
;
}
while
(
!
empty
(
$data
));
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