新版数智员工
This commit is contained in:
@@ -5,11 +5,10 @@ namespace app\store\model;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 流量订单模型
|
||||
* 流量套餐订单模型
|
||||
*/
|
||||
class FlowPackageOrderModel extends Model
|
||||
{
|
||||
// 设置表名
|
||||
protected $name = 'flow_package_order';
|
||||
|
||||
// 自动写入时间戳
|
||||
@@ -17,21 +16,6 @@ class FlowPackageOrderModel extends Model
|
||||
protected $createTime = 'createTime';
|
||||
protected $updateTime = 'updateTime';
|
||||
|
||||
// 类型转换
|
||||
protected $type = [
|
||||
'id' => 'integer',
|
||||
'userId' => 'integer',
|
||||
'packageId' => 'integer',
|
||||
'amount' => 'float',
|
||||
'duration' => 'integer',
|
||||
'createTime' => 'timestamp',
|
||||
'updateTime' => 'timestamp',
|
||||
'payTime' => 'timestamp',
|
||||
'status' => 'integer',
|
||||
'payStatus' => 'integer',
|
||||
'isDel' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* 生成订单号
|
||||
* 规则:LL + 年月日时分秒 + 5位随机数
|
||||
@@ -51,6 +35,7 @@ class FlowPackageOrderModel extends Model
|
||||
* 创建订单
|
||||
*
|
||||
* @param int $userId 用户ID
|
||||
* @param int $companyId 公司ID
|
||||
* @param int $packageId 套餐ID
|
||||
* @param string $packageName 套餐名称
|
||||
* @param float $amount 订单金额
|
||||
@@ -59,7 +44,7 @@ class FlowPackageOrderModel extends Model
|
||||
* @param string $remark 备注
|
||||
* @return array|false
|
||||
*/
|
||||
public static function createOrder($userId, $packageId, $packageName, $amount, $duration, $payType = 'wechat', $remark = '')
|
||||
public static function createOrder($userId, $companyId, $packageId, $packageName, $amount, $duration, $payType = 'wechat', $remark = '')
|
||||
{
|
||||
// 生成订单号
|
||||
$orderNo = self::generateOrderNo();
|
||||
@@ -67,6 +52,7 @@ class FlowPackageOrderModel extends Model
|
||||
// 订单数据
|
||||
$data = [
|
||||
'userId' => $userId,
|
||||
'companyId' => $companyId,
|
||||
'packageId' => $packageId,
|
||||
'packageName' => $packageName,
|
||||
'orderNo' => $orderNo,
|
||||
@@ -90,4 +76,5 @@ class FlowPackageOrderModel extends Model
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user