Commit 8a286985 authored by jianghaiming's avatar jianghaiming

update:set

parent 68ce832c
......@@ -14,7 +14,8 @@ class Goods implements DaemonServiceInterface
sleep(2);
$orderData = [
'online_status' => 1,
'expiration_time[<]' => date("Y-m-d H:i:s",time())
'expiration_time[<]' => date("Y-m-d H:i:s",time()),
'LIMIT' => 100,
];
$goodsList = GoodsSku::getRecords($orderData);
DaemonLog::info('DaemonServiceInterface_goods', json_encode($goodsList));
......
......@@ -15,7 +15,8 @@ class Marketing implements DaemonServiceInterface
sleep(2);
$orderData = [
'online_status' => 1,
'end_time[<]' => date("Y-m-d H:i:s",time())
'end_time[<]' => date("Y-m-d H:i:s",time()),
'LIMIT' => 100,
];
$orderInfoList = MarketingDao::getMarketingList($orderData);
DaemonLog::info('DaemonServiceInterface_marketing', json_encode($orderInfoList));
......@@ -25,7 +26,7 @@ class Marketing implements DaemonServiceInterface
$colums = [
'online_status' => 3,
];
MarketingDao::updateRecord($colums, $where);
MarketingDao::updateRecord($colums, $where);
}
}
......
......@@ -173,6 +173,10 @@ abstract class MysqlBase
*/
public static function getConnection($type, $flush = false)
{
if(PHP_SAPI == 'cli'){
// cli模式下,不走单例,gone away
$flush = true;
}
if (!isset(self::$dbConnect[static::CONFIG_INDEX.':'.$type]) || $flush) {
self::$dbConnect[static::CONFIG_INDEX.':'.$type] = new Medoo(self::getDbConf($type));
}
......@@ -495,4 +499,20 @@ abstract class MysqlBase
self::$dbConnect[static::CONFIG_INDEX.':'.$type] = self::getConnection($type);
return self::$dbConnect[static::CONFIG_INDEX.':'.$type]->action($actions);
}
/**
* 销毁所有已存在的连接,守护进程需要手动调用
*
* @return void
*/
public static function destroyConnetion()
{
if(self::$dbConnect) {
foreach(self::$dbConnect as $conn) {
$conn->pdo = null;
unset($conn);
}
self::$dbConnect = [];
}
}
}
......@@ -32,7 +32,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '600462a968b1b24b7361ad9d08540324e4e92c2b',
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -45,7 +45,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => '8e0eab96df9b2fea5fbba77fda27a0f60d2d0858',
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3',
),
'api/php_utils' =>
array (
......@@ -55,7 +55,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => 'b9d4473aeda808fa9ef25368bb7118b057741b62',
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4',
),
'bacon/bacon-qr-code' =>
array (
......@@ -334,7 +334,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '600462a968b1b24b7361ad9d08540324e4e92c2b',
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
),
),
);
......
......@@ -7,7 +7,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "8e0eab96df9b2fea5fbba77fda27a0f60d2d0858"
"reference": "cc3be45aa9bfc968b35f1d60c43115dae5f80da3"
},
"require": {
"api/php_utils": "dev-master",
......@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0",
"php": "7.2.*"
},
"time": "2021-07-19T11:36:47+00:00",
"time": "2021-07-19T12:51:28+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -34,7 +34,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "b9d4473aeda808fa9ef25368bb7118b057741b62"
"reference": "44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-07-15T13:56:09+00:00",
"time": "2021-07-19T16:13:22+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......
......@@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => '600462a968b1b24b7361ad9d08540324e4e92c2b',
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -19,7 +19,7 @@
array (
0 => '9999999-dev',
),
'reference' => '8e0eab96df9b2fea5fbba77fda27a0f60d2d0858',
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3',
),
'api/php_utils' =>
array (
......@@ -29,7 +29,7 @@
array (
0 => '9999999-dev',
),
'reference' => 'b9d4473aeda808fa9ef25368bb7118b057741b62',
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4',
),
'bacon/bacon-qr-code' =>
array (
......@@ -308,7 +308,7 @@
'aliases' =>
array (
),
'reference' => '600462a968b1b24b7361ad9d08540324e4e92c2b',
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
),
),
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment