|
@@ -94,7 +94,27 @@ class Index extends Api |
|
@@ -94,7 +94,27 @@ class Index extends Api |
94
|
function senWxmsgToDriverUser($order_id)
|
94
|
function senWxmsgToDriverUser($order_id)
|
95
|
{
|
95
|
{
|
96
|
$order=Db::name("order")->find($order_id);
|
96
|
$order=Db::name("order")->find($order_id);
|
97
|
-
|
97
|
+ if($order['user_id']){
|
|
|
98
|
+ $user=Db::name("user")->find($order['user_id']);
|
|
|
99
|
+ $wct_user=Db::name("wct_user")->where("unionid",$user['unionid'])->find();
|
|
|
100
|
+ $wxopenid=$wct_user['wx_openid'];
|
|
|
101
|
+ $sendInfo = array(
|
|
|
102
|
+ 'first' => array('value' => "汽车票出票状态通知", 'color' => "#743A3A"),
|
|
|
103
|
+ 'thing2' => array('value' => "{$order['starting_point']}-{$order['end_point']}", 'color' => '#173177'),
|
|
|
104
|
+ 'time3' => array('value' =>date("Y-m-d",time()), 'color' => '#173177'),
|
|
|
105
|
+ 'thing7' => array('value' =>"{$order['position']}", 'color' => '#173177'),
|
|
|
106
|
+ 'phone_number5' => array('value' => "{$order['phone']}", 'color' => '#173177'),
|
|
|
107
|
+ );
|
|
|
108
|
+ if ($wxopenid) {
|
|
|
109
|
+ $config = get_addon_config('wechat');
|
|
|
110
|
+ $tourl = '';
|
|
|
111
|
+ $ywt_appid = 'wxb7dd0c03865a94e0';
|
|
|
112
|
+ $pagepath = '';
|
|
|
113
|
+ $res = $this->sendAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath);
|
|
|
114
|
+ //print_r($res);return;
|
|
|
115
|
+ //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);
|
|
|
116
|
+ }
|
|
|
117
|
+ }
|
98
|
if($order['driver_id']){
|
118
|
if($order['driver_id']){
|
99
|
$driver=Db::name("driver")->find($order['driver_id']);
|
119
|
$driver=Db::name("driver")->find($order['driver_id']);
|
100
|
$user=Db::name("user")->find($driver['user_id']);
|
120
|
$user=Db::name("user")->find($driver['user_id']);
|
|
@@ -123,6 +143,27 @@ class Index extends Api |
|
@@ -123,6 +143,27 @@ class Index extends Api |
123
|
function refundToDriverUser($order_id)
|
143
|
function refundToDriverUser($order_id)
|
124
|
{
|
144
|
{
|
125
|
$order=Db::name("order")->find($order_id);
|
145
|
$order=Db::name("order")->find($order_id);
|
|
|
146
|
+ if($order['user_id']){
|
|
|
147
|
+ $user=Db::name("user")->find($order['user_id']);
|
|
|
148
|
+ $wct_user=Db::name("wct_user")->where("unionid",$user['unionid'])->find();
|
|
|
149
|
+ $wxopenid=$wct_user['wx_openid'];
|
|
|
150
|
+ $sendInfo = array(
|
|
|
151
|
+ 'first' => array('value' => "客户退票通知", 'color' => "#743A3A"),
|
|
|
152
|
+ 'thing1' => array('value' => "{$order['starting_point']}-{$order['end_point']}", 'color' => '#173177'),
|
|
|
153
|
+ 'time3' => array('value' =>urlencode(date('Y-m-d H:i:s', $order['reservation_time'])), 'color' => '#173177'),
|
|
|
154
|
+ 'thing6' => array('value' =>"{$order['starting_point']}", 'color' => '#173177'),
|
|
|
155
|
+ 'thing7' => array('value' =>"{$order['end_point']}", 'color' => '#173177'),
|
|
|
156
|
+ );
|
|
|
157
|
+
|
|
|
158
|
+ if ($wxopenid) {
|
|
|
159
|
+ $config = get_addon_config('wechat');
|
|
|
160
|
+ $tourl = '';
|
|
|
161
|
+ $ywt_appid = 'wxb7dd0c03865a94e0';
|
|
|
162
|
+ $pagepath = '';
|
|
|
163
|
+ $res = $this->refundAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath);
|
|
|
164
|
+ //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);
|
|
|
165
|
+ }
|
|
|
166
|
+ }
|
126
|
if($order['driver_id']){
|
167
|
if($order['driver_id']){
|
127
|
$driver=Db::name("driver")->find($order['driver_id']);
|
168
|
$driver=Db::name("driver")->find($order['driver_id']);
|
128
|
$user=Db::name("user")->find($driver['user_id']);
|
169
|
$user=Db::name("user")->find($driver['user_id']);
|