Commit 72b8293e authored by suntengda's avatar suntengda

update 拼单描述信息

parent 0ce10fe6
...@@ -8,6 +8,7 @@ use Api\PhpServices\Daemon\DaemonServiceInterface; ...@@ -8,6 +8,7 @@ use Api\PhpServices\Daemon\DaemonServiceInterface;
use Api\PhpUtils\Log\DaemonLog; use Api\PhpUtils\Log\DaemonLog;
use App\Models\marketing\mysql\Marketing; use App\Models\marketing\mysql\Marketing;
use Api\PhpServices\Wechat\Msg; use Api\PhpServices\Wechat\Msg;
use App\Models\marketing\mysql\MarketingPindan;
class Pindan implements DaemonServiceInterface class Pindan implements DaemonServiceInterface
{ {
...@@ -31,12 +32,9 @@ class Pindan implements DaemonServiceInterface ...@@ -31,12 +32,9 @@ class Pindan implements DaemonServiceInterface
$where["start_time[>]"] = $lastStartTime; $where["start_time[>]"] = $lastStartTime;
$where["end_time[>=]"] = $now; $where["end_time[>=]"] = $now;
$where['ORDER'] = ["update_time" => "DESC"]; $where['ORDER'] = ["update_time" => "DESC"];
$where['LIMIT'] = [0, 1]; $marketing = Marketing::get(['marketing_id','marketing_name','start_time'], $where);
$list = Marketing::select(["marketing_id", "marketing_name", "marketing_type","start_time", "end_time",
"online_status", "update_time", "create_time"]
, $where);
if(empty($list)) { if(empty($marketing)) {
DaemonLog::info( DaemonLog::info(
'DaemonServiceInterface_pindan', 'DaemonServiceInterface_pindan',
'no need to send at'.date('Y-m-d H:i:s') 'no need to send at'.date('Y-m-d H:i:s')
...@@ -44,6 +42,7 @@ class Pindan implements DaemonServiceInterface ...@@ -44,6 +42,7 @@ class Pindan implements DaemonServiceInterface
sleep(60); sleep(60);
return false; return false;
} }
$pindan = MarketingPindan::get(["pindan_desc"], ["marketing_id" => $marketing["marketing_id"]]);
//给订阅用户发送消息 //给订阅用户发送消息
//http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=71667995 //http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=71667995
...@@ -53,10 +52,11 @@ class Pindan implements DaemonServiceInterface ...@@ -53,10 +52,11 @@ class Pindan implements DaemonServiceInterface
$type = 2; // 1 公众号 2 小程序 $type = 2; // 1 公众号 2 小程序
//活动信息 //活动信息
$params = [ $params = [
self::emojiFilter($list[0]['marketing_name']), self::emojiFilter($marketing['marketing_name']),
$list[0]['start_time'], $marketing['start_time'],
$list[0]['pindan_desc'] ?: self::DEFAULT_DESC $pindan['pindan_desc'] ?: self::DEFAULT_DESC
]; ];
//发送消息 //发送消息
DaemonLog::info( DaemonLog::info(
'DaemonServiceInterface_pindan', 'DaemonServiceInterface_pindan',
......
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