<?php

namespace app\admin\controller;

use chuanglan\Chuanglan;
use payment\wechat\WechatTransfers;

class Index
{
    public function index()
    {
        return redirect('/admin.php/home');
    }

    public function t1()
    {
        halt(11);
        $batch_name   = '测试提现功能';//转账的名称
        $out_trade_no = 'lgd'.getUniId();//单号
        $money        = 1;//金额
        $openid       = 'o4a9g5ffjsMcXS9wCtTyONqMTdEc';//用户openid
        $detail = [];
        $transfers = new WechatTransfers();
        $detail[] = $transfers->getDetailList($out_trade_no,$money,$batch_name,$openid);
        $res = $transfers->transfers($batch_name,$detail);
        halt($res);
    }

    public function t2()
    {
        halt(22);
        $msg = '福利商城有订单已超过24小时未发货，订单号：请及时发货';
        $mobile = '13313826760';
        $sms = new Chuanglan();
        $res = $sms->send($mobile,['message'=>$msg]);
        halt($res);
    }
}
