6
0
Fork 0
release
panliang 2022-05-18 11:19:11 +08:00
parent ab018a431f
commit eece8679ca
4 changed files with 7 additions and 10 deletions

View File

@ -25,4 +25,9 @@ class UserVip extends Model
{
return $this->belongsTo(Vip::class, 'vip_id');
}
public function pay()
{
return $this->morphOne(PayLog::class, 'payable');
}
}

View File

@ -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('未知的支付方式');
}

View File

@ -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('价格');

View File

@ -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);