<?php
declare (strict_types = 1);

namespace app\model\api;

use library\basic\BaseModel;
use think\Model;

/**
 * @mixin \think\Model
 */
class PayTrade extends BaseModel
{

    /**
     * 生成凭证
     */
    public function mkTrade($data) {
       $d['pay_no'] = '';
       $d['out_trade_no'] = $data['out_trade_no'];
       $d['uid'] = $data['uid'];
       $d['tag'] = $data['tag'];
       $d['type'] = $data['type'];
       $d['money'] = $data['money'];
       $d['content'] = empty($data['content']) ? '' : $data['content'];
       $d['d_json'] = empty($data['d_json']) ? '[]' : json_encode($data['d_json']);
       $d['time'] = time();
       $d['sassid'] = empty($data['sassid']) ? 0 : $data['sassid'];
       $this->insert($d);
    }

}
