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); $user = User::find($order->user_id);
$plan = Plan::find($order->plan_id); $plan = Plan::find($order->plan_id);
switch ($plan->type) { if ($order->cycle === 'onetime_price') {
// cycle return $this->buyByOneTime($order, $user, $plan);
case 0: return $this->buyByCycle($order, $user, $plan);
// onetime
case 1: 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) private function buyByCycle(Order $order, User $user, Plan $plan)

View File

@ -10,7 +10,6 @@ class PlanSave extends FormRequest
'name' => 'required', 'name' => 'required',
'content' => '', 'content' => '',
'group_id' => 'required', 'group_id' => 'required',
'type' => 'required|in:0,1',
'transfer_enable' => 'required', 'transfer_enable' => 'required',
'month_price' => 'nullable|integer', 'month_price' => 'nullable|integer',
'quarter_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` ALTER TABLE `v2_tutorial`
DROP `description`; DROP `description`;
ALTER TABLE `v2_plan`
ADD `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0: 周期 1:一次性' AFTER `name`;
ALTER TABLE `v2_plan` ALTER TABLE `v2_plan`
CHANGE `month_price` `month_price` int(11) NULL AFTER `content`, CHANGE `month_price` `month_price` int(11) NULL AFTER `content`,
CHANGE `quarter_price` `quarter_price` int(11) NULL AFTER `month_price`, CHANGE `quarter_price` `quarter_price` int(11) NULL AFTER `month_price`,

File diff suppressed because one or more lines are too long