宝体数据调用接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
885 B

<?php
namespace app\api\model;
use app\common\model\WxappPrepayId as WxappPrepayIdModel;
use app\common\enum\OrderType as OrderTypeEnum;
/**
* 小程序prepay_id模型
* Class WxappPrepayId
* @package app\api\model
*/
class WxappPrepayId extends WxappPrepayIdModel
{
/**
* 新增记录
* @param $prepayId
* @param $orderId
* @param $userId
* @param int $orderType
* @return false|int
*/
public function add($prepayId, $orderId, $userId, $orderType = OrderTypeEnum::MASTER)
{
return $this->save([
'prepay_id' => $prepayId,
'order_id' => $orderId,
'order_type' => $orderType,
'user_id' => $userId,
'can_use_times' => 0,
'used_times' => 0,
'expiry_time' => time() + (7 * 86400),
'wxapp_id' => self::$wxapp_id,
]);
}
}