...
|
...
|
@@ -94,7 +94,27 @@ class Index extends Api |
|
|
function senWxmsgToDriverUser($order_id)
|
|
|
{
|
|
|
$order=Db::name("order")->find($order_id);
|
|
|
|
|
|
if($order['user_id']){
|
|
|
$user=Db::name("user")->find($order['user_id']);
|
|
|
$wct_user=Db::name("wct_user")->where("unionid",$user['unionid'])->find();
|
|
|
$wxopenid=$wct_user['wx_openid'];
|
|
|
$sendInfo = array(
|
|
|
'first' => array('value' => "汽车票出票状态通知", 'color' => "#743A3A"),
|
|
|
'thing2' => array('value' => "{$order['starting_point']}-{$order['end_point']}", 'color' => '#173177'),
|
|
|
'time3' => array('value' =>date("Y-m-d",time()), 'color' => '#173177'),
|
|
|
'thing7' => array('value' =>"{$order['position']}", 'color' => '#173177'),
|
|
|
'phone_number5' => array('value' => "{$order['phone']}", 'color' => '#173177'),
|
|
|
);
|
|
|
if ($wxopenid) {
|
|
|
$config = get_addon_config('wechat');
|
|
|
$tourl = '';
|
|
|
$ywt_appid = 'wxb7dd0c03865a94e0';
|
|
|
$pagepath = '';
|
|
|
$res = $this->sendAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath);
|
|
|
//print_r($res);return;
|
|
|
//file_put_contents("pcl_wct_send.log", date("Y-m-d H:i:s") . "1-2-" . json_encode($res, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND);
|
|
|
}
|
|
|
}
|
|
|
if($order['driver_id']){
|
|
|
$driver=Db::name("driver")->find($order['driver_id']);
|
|
|
$user=Db::name("user")->find($driver['user_id']);
|
...
|
...
|
@@ -123,6 +143,27 @@ class Index extends Api |
|
|
function refundToDriverUser($order_id)
|
|
|
{
|
|
|
$order=Db::name("order")->find($order_id);
|
|
|
if($order['user_id']){
|
|
|
$user=Db::name("user")->find($order['user_id']);
|
|
|
$wct_user=Db::name("wct_user")->where("unionid",$user['unionid'])->find();
|
|
|
$wxopenid=$wct_user['wx_openid'];
|
|
|
$sendInfo = array(
|
|
|
'first' => array('value' => "客户退票通知", 'color' => "#743A3A"),
|
|
|
'thing1' => array('value' => "{$order['starting_point']}-{$order['end_point']}", 'color' => '#173177'),
|
|
|
'time3' => array('value' =>urlencode(date('Y-m-d H:i:s', $order['reservation_time'])), 'color' => '#173177'),
|
|
|
'thing6' => array('value' =>"{$order['starting_point']}", 'color' => '#173177'),
|
|
|
'thing7' => array('value' =>"{$order['end_point']}", 'color' => '#173177'),
|
|
|
);
|
|
|
|
|
|
if ($wxopenid) {
|
|
|
$config = get_addon_config('wechat');
|
|
|
$tourl = '';
|
|
|
$ywt_appid = 'wxb7dd0c03865a94e0';
|
|
|
$pagepath = '';
|
|
|
$res = $this->refundAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath);
|
|
|
//file_put_contents("pcl_wct_send.log", date("Y-m-d H:i:s") . "1-2-" . json_encode($res, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND);
|
|
|
}
|
|
|
}
|
|
|
if($order['driver_id']){
|
|
|
$driver=Db::name("driver")->find($order['driver_id']);
|
|
|
$user=Db::name("user")->find($driver['user_id']);
|
...
|
...
|
|