update onetime package

This commit is contained in:
Tokumeikoi 2020-03-01 23:18:45 +08:00
parent e2b73094c0
commit 60b197410c
4 changed files with 4 additions and 11 deletions

View File

@ -64,13 +64,10 @@ class CheckOrder extends Command
{
$user = User::find($order->user_id);
$plan = Plan::find($order->plan_id);
switch ($plan->type) {
// cycle
case 0: return $this->buyByCycle($order, $user, $plan);
// onetime
case 1: return $this->buyByOneTime($order, $user, $plan);
if ($order->cycle === 'onetime_price') {
return $this->buyByOneTime($order, $user, $plan);
}
return $this->buy($order, $user, $plan);
return $this->buyByCycle($order, $user, $plan);
}
private function buyByCycle(Order $order, User $user, Plan $plan)

View File

@ -10,7 +10,6 @@ class PlanSave extends FormRequest
'name' => 'required',
'content' => '',
'group_id' => 'required',
'type' => 'required|in:0,1',
'transfer_enable' => 'required',
'month_price' => 'nullable|integer',
'quarter_price' => 'nullable|integer',

View File

@ -169,9 +169,6 @@ ADD `category_id` int(11) NOT NULL AFTER `id`;
ALTER TABLE `v2_tutorial`
DROP `description`;
ALTER TABLE `v2_plan`
ADD `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0: 周期 1:一次性' AFTER `name`;
ALTER TABLE `v2_plan`
CHANGE `month_price` `month_price` int(11) NULL AFTER `content`,
CHANGE `quarter_price` `quarter_price` int(11) NULL AFTER `month_price`,

File diff suppressed because one or more lines are too long