user
parent
ab018a431f
commit
eece8679ca
|
|
@ -25,4 +25,9 @@ class UserVip extends Model
|
|||
{
|
||||
return $this->belongsTo(Vip::class, 'vip_id');
|
||||
}
|
||||
|
||||
public function pay()
|
||||
{
|
||||
return $this->morphOne(PayLog::class, 'payable');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class VipService
|
|||
'trade_type' => WxpayTradeType::JSAPI->value,
|
||||
'openid' => $openid,
|
||||
];
|
||||
return (new WxpayService())->pay($params);
|
||||
return ['pay_way' => $pay_way, 'data' => (new WxpayService())->pay($params)];
|
||||
}
|
||||
throw new BizException('未知的支付方式');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class CreateVipsTable extends Migration
|
|||
});
|
||||
Schema::create('user_vips', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id')->unique()->comment('用户ID');
|
||||
$table->unsignedBigInteger('user_id')->comment('用户ID');
|
||||
$table->unsignedBigInteger('vip_id')->comment('会员ID');
|
||||
$table->string('name')->comment('名称');
|
||||
$table->decimal('price', 12, 2)->default(0)->comment('价格');
|
||||
|
|
|
|||
|
|
@ -100,14 +100,6 @@ class AppSettingSeeder extends Seeder
|
|||
'merchant_master_secret' => 'HCB87uFoF18iWsKHf7VY57',
|
||||
],
|
||||
'remarks' => '个推配置',
|
||||
],
|
||||
'custom' => [
|
||||
'value' => [
|
||||
'key_value' => [
|
||||
'wechat_mini_show_vip_banner' => 'https://zcs-test.oss-cn-chengdu.aliyuncs.com/ac/is_vip.png',
|
||||
'wechat_mini_become_vip_banner' => 'https://zcs-test.oss-cn-chengdu.aliyuncs.com/ac/not_vip.png',
|
||||
]
|
||||
]
|
||||
]
|
||||
] as $key => $values) {
|
||||
Setting::firstOrCreate(['key' => $key], $values);
|
||||
|
|
|
|||
Loading…
Reference in New Issue