Commit 17424c5d authored by wwccw0591's avatar wwccw0591

更新

parent c0462517
......@@ -1202,11 +1202,12 @@ class OrderConfirmUtil {
}
$orderCon = array('pay_sn'=>$paySn,'order_state'=>array('in',array(\Our\ApiConst::orderStateWaitPay,ApiConst::orderStateCancel)));
$orderList = $orderModel->getListByCon($orderCon,'order_id,coupon_id,buyer_id,store_id,order_sn');
$orderList = $orderModel->getListByCon($orderCon,'order_id,order_sn, store_name, buyer_id, order_amount, payment_time, order_state, prepay_id,coupon_id');
if(!$orderList){
$errorCode = \Error\CodeConfigModel::noOrderListForPay;
return array('flag'=>\Our\ApiConst::zero,'errorCode'=>$errorCode,'data'=>$data);
}
$order = $orderList[0];
$memberId = $orderList[0]['buyer_id'];
$updateOrder = array();
$updateOrder['order_state'] = \Our\ApiConst::orderStateWaitConfirm;
......@@ -1242,6 +1243,12 @@ class OrderConfirmUtil {
}*/
$orderModel->db->doCommit();
//支付支付成功微信小程序模板消息
$settingDAO = \DAO\SettingModel::getInstance();
$msg_tpl = $settingDAO->getListCache(array('wxapp_order_paysucc_tpl'))['wxapp_order_paysucc_tpl'];
\Business\Order\OrderServiceModel::getInstance()->sendPaymentMessage($order, $msg_tpl);
//发送订单消息
$this->deleteCacheInfo($memberId);
$this->pushMessage();
return array('flag'=>\Our\ApiConst::one,'errorCode'=>$errorCode);
......
......@@ -128,9 +128,10 @@ class OrderServiceModel extends \Business\AbstractModel
if($json['errmsg']=='ok') {
$model->updateByOrderId(array('msg_status'=>2), $order['order_id']);
// echo 'order[' . $order['order_id'] .'] send payment succ'."\n";
return true;
}
}
return false;
}
public function sendShippingMessage($order, $msg_tpl) {
......@@ -174,9 +175,11 @@ class OrderServiceModel extends \Business\AbstractModel
if($json['errmsg']=='ok') {
$model->updateByOrderId(array('msg_status'=>3), $order['order_id']);
// echo 'order[' . $order['order_id'] .'] send shipping succ'."\n";
return true;
}
}
return false;
}
......@@ -230,9 +233,11 @@ class OrderServiceModel extends \Business\AbstractModel
if($json['errmsg']=='ok') {
$model->updateByOrderId(array('msg_status'=>4), $order['order_id']);
// echo 'order[' . $order['order_id'] .'] send reciver succ'."\n";
return true;
}
}
return false;
}
/**
......@@ -251,7 +256,7 @@ class OrderServiceModel extends \Business\AbstractModel
//付款7天内付款消息通知
$where = array('msg_status'=>array('elt', 1), 'payment_type'=>5, 'order_state'=>array('egt',20), 'prepay_id'=>
array('neq',
''), 'payment_time'=>array('gt', TIMESTAMP-7*24*60*60));
''), 'payment_time'=>array('between', TIMESTAMP-7*24*60*60, TIMESTAMP-10));
if($list = $model->getList($where, 'order_id,order_sn, store_name, buyer_id, order_amount, payment_time, order_state, prepay_id', 0, 10, array('payment_time'=>'asc'))) {
echo 'order count: '.count($list['list'])."\n";
$msg_tpl = $wxapp_templates['wxapp_order_paysucc_tpl'];
......
......@@ -145,4 +145,4 @@ class PaymentServiceModel extends \Business\AbstractModel{
return self::$_instance;
}
}
\ No newline at end of file
}
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