LoadController.php 1.5 KB
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/7
 * Time: 16:48
 */

namespace app\portal\controller;


use app\portal\model\IndentModel;
use cmf\controller\HomeBaseController;

class LoadController extends HomeBaseController
{
    public function index(){
        $indentModel = new IndentModel();
        $where['state'] = ['eq',2];
        $data = $indentModel->selectData($where);
        if(!empty($data)){
            foreach($data as $key => $vo){
                $birdController = new BirdController();
                $result = $birdController->getOrder($vo['id']);
            }
        }
    }
    public function test(){

        dump(cache('param'));
        dump(cache('result'));
        dump(cache('data'));
    }
    public function notify(){

        $data = file_get_contents('php://input');
        $msg  = explode("&", $data);
        foreach ($msg as $k => $v) {
            $p = explode("=", $v);
            if ($p[0] == "RequestData") {
                $result[$p[0]] = json_decode(urldecode($p[1]),true);
            } else {
                $result[$p[0]] = urldecode($p[1]);
            }
        }
        /*echo '<pre>';
        print_r($res);exit;*/
        $data = '{
                "EBusinessID": "'.$result['RequestData']['EBusinessID'].'",
                "UpdateTime": "'. date('Y-m-d H:i:s', time()) .'",
                "Success": true,
                "Reason": ""
            }';
        cache('data',$data);
        echo $data;
    }
}