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
7c3a89cd
Commit
7c3a89cd
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
70780078
6a64cb4a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
559 additions
and
9 deletions
+559
-9
Index.php
application/controllers/Index.php
+3
-1
Abstract.php
application/library/Our/Controller/Abstract.php
+1
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+12
-4
MessageService.php
application/models/Business/Message/MessageService.php
+6
-0
MongoDb.php
application/models/Mongo/MongoDb.php
+530
-0
application.ini
conf/application.ini
+2
-0
jpush.log
public/jpush.log
+2
-0
test.php
public/test.php
+2
-2
jpush.php
scripts/crontab/push/jpush.php
+1
-1
No files found.
application/controllers/Index.php
View file @
7c3a89cd
...
@@ -54,7 +54,9 @@ class IndexController extends \Our\Controller_Abstract {
...
@@ -54,7 +54,9 @@ class IndexController extends \Our\Controller_Abstract {
public
function
indexAction
()
{
public
function
indexAction
()
{
// $clientPush=\JPush\ClientPush::getInstance();
// $clientPush=\JPush\ClientPush::getInstance();
// $clientPush->pushAll();
// $clientPush->pushAll();
echo
'success'
;
$mongoDb
=
new
\Mongo\MongoDbModel
();
$res
=
$mongoDb
->
insert
(
'message_history'
,
array
(
'id'
=>
1
,
'name'
=>
'chenchuanwen'
));
echo
json_encode
(
$res
);
exit
;
exit
;
\Our\Log
::
getInstance
()
->
write
(
'testLog|||||testLog'
);
\Our\Log
::
getInstance
()
->
write
(
'testLog|||||testLog'
);
var_dump
(
$_SERVER
);
exit
;
var_dump
(
$_SERVER
);
exit
;
...
...
application/library/Our/Controller/Abstract.php
View file @
7c3a89cd
...
@@ -36,7 +36,7 @@ abstract class Controller_Abstract extends \Yaf\Controller_Abstract {
...
@@ -36,7 +36,7 @@ abstract class Controller_Abstract extends \Yaf\Controller_Abstract {
$data
[
'responseContent'
]
=
$returnMessage
[
'responseContent'
];
$data
[
'responseContent'
]
=
$returnMessage
[
'responseContent'
];
$data
[
'data'
]
=
array
();
$data
[
'data'
]
=
array
();
$data
[
'data'
]
=
$this
->
req
[
NameConst
::
data
];
$data
[
'data'
]
=
$this
->
req
[
NameConst
::
data
];
if
(
APP_ENV
==
'test'
){
if
(
APP_ENV
==
'test'
||
APP_ENV
==
'pre'
){
$log
=
\Our\Log
::
getInstance
();
$log
=
\Our\Log
::
getInstance
();
$log
->
write
(
json_encode
(
$data
));
$log
->
write
(
json_encode
(
$data
));
}
}
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
7c3a89cd
...
@@ -825,10 +825,18 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -825,10 +825,18 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
$storeId
&&
$where
[
'han_goods_attribute.store_id'
]
=
$storeId
;
$storeId
&&
$where
[
'han_goods_attribute.store_id'
]
=
$storeId
;
$storeId
||
$where
[
'source'
]
=
1
;
//来源:平台
$storeId
||
$where
[
'source'
]
=
1
;
//来源:平台
$firstClassId
&&
$where
[
'gc_id_1'
]
=
$firstClassId
;
if
(
$keyword
!==
''
)
{
$secondClassId
&&
$where
[
'gc_id_2'
]
=
$secondClassId
;
$firstClassId
&&
$where
[
'han_goods_attribute.gc_id_1'
]
=
$firstClassId
;
$thirdClassId
&&
$where
[
'gc_id_3'
]
=
$thirdClassId
;
$secondClassId
&&
$where
[
'han_goods_attribute.gc_id_2'
]
=
$secondClassId
;
$storeThirdClassId
&&
$where
[
'goods_class_t_id'
]
=
$storeThirdClassId
;
$thirdClassId
&&
$where
[
'han_goods_attribute.gc_id_3'
]
=
$thirdClassId
;
$storeThirdClassId
&&
$where
[
'han_goods_attribute.goods_class_t_id'
]
=
$storeThirdClassId
;
}
else
{
$firstClassId
&&
$where
[
'gc_id_1'
]
=
$firstClassId
;
$secondClassId
&&
$where
[
'gc_id_2'
]
=
$secondClassId
;
$thirdClassId
&&
$where
[
'gc_id_3'
]
=
$thirdClassId
;
$storeThirdClassId
&&
$where
[
'goods_class_t_id'
]
=
$storeThirdClassId
;
}
$where
[
'is_filter'
]
=
1
;
$where
[
'is_filter'
]
=
1
;
$productData
=
[];
$productData
=
[];
$attributeRedis
=
\Redis\Db4\GoodsAttributeRedisModel
::
getInstance
();
$attributeRedis
=
\Redis\Db4\GoodsAttributeRedisModel
::
getInstance
();
...
...
application/models/Business/Message/MessageService.php
View file @
7c3a89cd
...
@@ -443,6 +443,7 @@ class MessageServiceModel extends \Business\AbstractModel
...
@@ -443,6 +443,7 @@ class MessageServiceModel extends \Business\AbstractModel
$message
[
'gmtCreate'
]
=
TIMESTAMP
;
$message
[
'gmtCreate'
]
=
TIMESTAMP
;
$message
[
'isRead'
]
=
ApiConst
::
unread
;
$message
[
'isRead'
]
=
ApiConst
::
unread
;
$message
[
'type'
]
=
(
int
)
$message
[
'type'
];
$message
[
'type'
]
=
(
int
)
$message
[
'type'
];
$message
[
'content'
]
=
base64_encode
(
$message
[
'content'
]);
$serializeMessage
=
serialize
(
$message
);
$serializeMessage
=
serialize
(
$message
);
//将消息添加到表messageHistory
//将消息添加到表messageHistory
$mesageHistory
[
'fromId'
]
=
$fromId
;
$mesageHistory
[
'fromId'
]
=
$fromId
;
...
@@ -480,6 +481,11 @@ class MessageServiceModel extends \Business\AbstractModel
...
@@ -480,6 +481,11 @@ class MessageServiceModel extends \Business\AbstractModel
register_shutdown_function
(
array
(
$messageHistoryDao
,
"sendMessage"
),
$mesageHistory
,
$toId
);
register_shutdown_function
(
array
(
$messageHistoryDao
,
"sendMessage"
),
$mesageHistory
,
$toId
);
//$messageHistoryDao->sendMessage($mesageHistory,$toId);
//$messageHistoryDao->sendMessage($mesageHistory,$toId);
if
(
$res1
&&
$res2
)
{
if
(
$res1
&&
$res2
)
{
$clientPush
=
\JPush\ClientPush
::
getInstance
();
$mesageHistory
[
'id'
]
=
$res1
;
$addData
[
'message'
]
=
unserialize
(
$mesageHistory
[
'message'
]);
$addData
[
'message'
][
'content'
]
=
base64_decode
(
$addData
[
'message'
][
'content'
]);
$clientPush
->
push
(
$addData
);
return
$res1
;
return
$res1
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
application/models/Mongo/MongoDb.php
0 → 100644
View file @
7c3a89cd
This diff is collapsed.
Click to expand it.
conf/application.ini
View file @
7c3a89cd
...
@@ -49,6 +49,8 @@ push.clientHost="wss://api.shenbd.com/wss"
...
@@ -49,6 +49,8 @@ push.clientHost="wss://api.shenbd.com/wss"
push.host
=
"172.16.142.15"
push.host
=
"172.16.142.15"
push.port
=
"9503"
push.port
=
"9503"
push.open
=
1
push.open
=
1
push.user.service.id
=
293
push.user.service.type
=
7
;
;
elastic.master.host
=
"172.16.142.15"
elastic.master.host
=
"172.16.142.15"
elastic.master.port
=
"9200"
elastic.master.port
=
"9200"
...
...
public/jpush.log
0 → 100644
View file @
7c3a89cd
Send POST https://api.jpush.cn/v3/push, body:{"platform":"all","audience":"all","notification":{"alert":"Hi, JPush"},"options":{"sendno":1913510038,"apns_production":false}}, times:1
Send POST https://api.jpush.cn/v3/push, body:{"platform":"all","audience":"all","notification":{"alert":"Hi, JPush"},"options":{"sendno":93988000,"apns_production":false}}, times:1
public/test.php
View file @
7c3a89cd
<?php
<?php
echo
1
;
exit
;
echo
1
4
;
exit
;
$redis
=
new
Redis
();
$redis
=
new
Redis
();
$redis
->
connect
(
'127.0.0.1'
,
'6379'
);
$redis
->
connect
(
'127.0.0.1'
,
'6379'
);
$redis
->
rPush
(
'test'
,
0
);
$redis
->
rPush
(
'test'
,
0
);
$res
=
$redis
->
lPop
(
'test'
);
$res
=
$redis
->
lPop
(
'test'
);
var_dump
(
$res
);
var_dump
(
$res
);
?>
?>
\ No newline at end of file
scripts/crontab/push/jpush.php
View file @
7c3a89cd
...
@@ -48,7 +48,7 @@ class cliOrderClose extends basecli
...
@@ -48,7 +48,7 @@ class cliOrderClose extends basecli
$redis
->
auth
(
$conf
[
'password'
]);
$redis
->
auth
(
$conf
[
'password'
]);
}
}
$clientPush
=
\JPush\ClientPush
::
getInstance
();
$clientPush
=
\JPush\ClientPush
::
getInstance
();
$messageService
=
\DAO\MessageHistoryModel
::
getInstance
();
//
$messageService=\DAO\MessageHistoryModel::getInstance();
while
(
$pushData
=
$redis
->
lPop
(
'push_center'
)){
while
(
$pushData
=
$redis
->
lPop
(
'push_center'
)){
$addData
=
unserialize
(
$pushData
);
$addData
=
unserialize
(
$pushData
);
$addData
[
'message'
]
=
unserialize
(
$addData
[
'message'
]);
$addData
[
'message'
]
=
unserialize
(
$addData
[
'message'
]);
...
...
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