作者 xwp
1 个管道 的构建 通过 耗费 1 秒

推送调试

... ... @@ -570,23 +570,23 @@ class Course extends Api
'form_id'=>$k['id'],
'page'=>'pages/classReserve/classReserve',
'data'=>[
"thing2" => ["value" => $courseStore['course']['name']],
/*"thing2" => ["value" => $courseStore['course']['name']],
"thing4" => ["value" => $courseStore['store']['address']],
"date1" => ["value" => $k['CourseStore']['start']],
"name3" => ["value" => $k['user']['nickname']],
"thing5" => ["value" => "课程预约成功"],
"thing5" => ["value" => "课程预约成功"],*/
"thing2" => ["value" => $courseStore['store']['address']],
"thing3" => ["value" => $courseStore['course']['name']],
"time4" => ["value" => $k['CourseStore']['start']],
],
];
echo '微信请求:'.json_encode($data);
try {
$return = $template->send($data);
echo json_encode($return);exit;
$template->send($data);
} catch (InvalidResponseException $e) {
echo '抛出1:'.json_encode($e->getMessage());exit;
} catch (LocalCacheException $e) {
echo '抛出2:'.json_encode($e->getMessage());exit;
}
}
... ...
... ... @@ -41,7 +41,7 @@ class Order extends Api
$course_id = $this->request->request('course_id');
if(!empty($course_id)){
$product = new \app\admin\model\Product();
$product = $product->where($where)->select();
$product = $product->where($where)->order('weigh','desc')->select();
$productCourse = new \app\admin\model\ProductCoures();
$return = [];
foreach ($product as $K){
... ... @@ -56,7 +56,7 @@ class Order extends Api
}
}else{
$product = new \app\admin\model\Product();
$return = $product->where($where)->select();
$return = $product->where($where)->order('weigh','desc')->select();
}
... ... @@ -144,6 +144,7 @@ class Order extends Api
$data['start'] = $now;
$data['end'] = date('Y-m-d H:i:s',strtotime('+'.$product['dateCount'].' day',strtotime($now)));
$data['success_time'] = '';
$data['notify'] = false;
$order = new \app\admin\model\Order();
$order = $order->insertGetId($data);
... ...
... ... @@ -25,6 +25,8 @@
*/
use think\Config;
use WeChat\Exceptions\InvalidResponseException;
use WeChat\Exceptions\LocalCacheException;
use WeMini\Newtmpl;
use Workerman\Lib\Timer;
... ... @@ -49,11 +51,8 @@ class Events
'appsecret' => '2c2aa784ee902248d7360dde74c8e299',
'mch_id' => '1577676721',
'mch_key' => 'MmXiXHO16b89tNx75t3T8rHTYMQBbn19',
//'notify_url' => '127.0.0.1/wake/public/api/order/notify',
'notify_url' => 'https://wake.w.brotop.cn/api/order/notify',
//'course_sign_tmp' => '0A7sPV2VrDo7_3Fo5q9z-Ddh-m85_GvF15ANspbo70Ey',
'course_sign_tmp' => 'Y24N0zGcKj2tEFOh1elMoy5j5ppRK8MSGGINyaX5gYc',
//'course_start_tmp' => '0A7sPV2VrDo7_3Fo5q9z-Ddh-m85_GvF15ANspbo70Ey',
'course_sign_tmp' => 'yBH9F7IO75_fc7w4SDWIrmTyLHsPLZ5fOf2Z4jwY-Q4',
'course_start_tmp' => 'Y24N0zGcKj2tEFOh1elMoy5j5ppRK8MSGGINyaX5gYc',
'order_over_tmp' => '586FN0OLJ1DPZgwPwh7Ke2P4wewhm7l67awB77qrOi8',
];
... ... @@ -65,11 +64,12 @@ class Events
error_log('order_over');
$template = new Newtmpl($config);
$order = new \app\admin\model\Order();
$order = $order->where(['status'=>'success','end'=>['<',date('Y-m-d H:i:s')]])->with('user')->select();
$order = $order->where(['status'=>'success','end'=>['<',date('Y-m-d H:i:s'), 'notify'=> false]])->with('user')->select();
$notice = new \app\admin\model\UserNotice();
foreach ($order as $k){
$order = new \app\admin\model\Order();
$order->save(['status'=>'over'],['id'=>$k['id']]);
$order->save(['status'=>'over','notify'=>true],['id'=>$k['id']]);
$insert = [
'user_id' => $k['id'],
... ... @@ -91,7 +91,13 @@ class Events
"name3" => ["value" => $k['user']['nickname']],
],
];
$template->send($data);
try {
$template->send($data);
} catch (InvalidResponseException $e) {
} catch (LocalCacheException $e) {
}
}
});
... ... @@ -146,7 +152,12 @@ class Events
],
];
$template->send($data);
try {
$template->send($data);
} catch (InvalidResponseException $e) {
} catch (LocalCacheException $e) {
}
}
}
});
... ...