Wechat.php 1.0 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\inter\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use think\Session;
  6. use app\common\library\UUIDs;
  7. use think\Cache;
  8. use think\Log;
  9. use app\common\library\Verify;
  10. use think\File;
  11. use app\common\library\send_message;
  12. use app\common\library\Message;
  13. class Application extends Base {
  14. public function payConfirm() {
  15. $param = $_REQUEST['param'];
  16. $order_id = $param['order_id'];
  17. $remote_order = DB::table('remote_order')->where('id', $order_id)->find();
  18. if(!$remote_order) {
  19. return json_encode(['status'=>'fail','code'=>'3001','msg'=> "没有找到该订单"]);
  20. }
  21. if($remote_order !== Application::ORDER_STATUS['CREATE']) {
  22. return json_encode(['status'=>'fail','code'=>'3002','msg'=> "订单状态出错"]);
  23. }
  24. DB::table('remote_order')->where('id', $order_id)->update(["status" => Application::ORDER_STATUS['PAYCOMPLTET']]);
  25. return json_encode(['status'=>'ok','code'=>'0000','msg'=> "支付回调成功"]);
  26. }
  27. }