作者 王晓刚
1 个管道 的构建 通过 耗费 2 秒

去除保险时间字段

... ... @@ -50,7 +50,7 @@ class OrderInfoModel extends Model
public function selectData($where1,$whereor=null){
$time = time();
$where1['o.delete_time'] = ['eq',0];
$where1['c.expire_time'] = ['>',time()];//判断保单是否还在缴费期限内
// $where1['c.expire_time'] = ['>',time()];//判断保单是否还在缴费期限内
// $where1['o.order_expire_time'] = ['>',time()];//筛选出托管中状态
// $where1['o.order_about_time'] = ['>',(time()-30*24*60*60)];//筛选出托管中状态
//$where1['o.status'] = ['eq',3];//筛选出托管中状态
... ...
... ... @@ -39,7 +39,7 @@ class PayController extends HomeBaseController
$attributes = [
'trade_type' => 'JSAPI',
'body' => '橙象保单',
'detail' => '以客户为中心 以奋斗者文本',
'detail' => '橙象',
'out_trade_no' => $data['num'],
'total_fee' => $data['total']*100,//1, // 单位:分
'notify_url' => url('portal/pay/notify','','',true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址
... ... @@ -92,23 +92,11 @@ class PayController extends HomeBaseController
// 用户是否支付成功
if ($successful) {
Db::name('order_num')->insert(array('user_id'=>$order['user_id'],'create_time'=>time()));
$data4 = [];
$payment_time = $collocation['payment_time'];
for($i=0;$i<$payment_time;$i++){
if($collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60)>time()){
$data3['user_id'] = $order['user_id'];
$data3['order_id'] = $order['id'];
$data3['collocation_id'] = $collocation['id'];
$data3['time'] = $collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60);
$data4[] = $data3;
}
}
Db::name('send')->insertAll($data4);
$update['pay_time']=time();
//未支付状态则修改为已经支付状态
$update['status'] = 3;
$update['order_expire_time']=$collocation['expire_time'];
$update['order_about_time']=$data4[count($data4)-1]['time'];
$update['order_about_time']=$collocation['expire_time']-(30*24*60*60);
//推送模板消息
$templateId = 'iZwqjrOt7NCILnI0zkayK59y4jUXmnmfmROERWq-NEw';
$data1 = array(
... ...