mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-08 18:08:13 -05:00
fix(coupon): correct knows issues
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
This commit is contained in:
parent
8f88e11403
commit
caade5c791
@ -11,11 +11,11 @@ class CouponController extends Controller
|
||||
{
|
||||
public function check(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'code' => 'required|string',
|
||||
'plan_id' => 'required|integer',
|
||||
'period' => 'nullable|string',
|
||||
]);
|
||||
// $request->validate([
|
||||
// 'code' => 'required|string',
|
||||
// 'plan_id' => 'required|integer',
|
||||
// 'period' => 'nullable|string',
|
||||
// ]);
|
||||
if (empty($request->input('code'))) {
|
||||
return $this->fail([422,__('Coupon cannot be empty')]);
|
||||
}
|
||||
|
@ -114,7 +114,8 @@ class PlanService
|
||||
*/
|
||||
public static function convertToLegacyPeriod(string $period): string
|
||||
{
|
||||
return Plan::LEGACY_PERIOD_MAPPING[$period] ?? $period;
|
||||
$flippedMapping = array_flip(Plan::LEGACY_PERIOD_MAPPING);
|
||||
return $flippedMapping[$period] ?? $period;
|
||||
}
|
||||
|
||||
/**
|
||||
|
8
public/assets/admin/assets/index.js
vendored
8
public/assets/admin/assets/index.js
vendored
File diff suppressed because one or more lines are too long
10
public/assets/admin/locales/en-US.js
vendored
10
public/assets/admin/locales/en-US.js
vendored
@ -1219,6 +1219,16 @@ window.XBOARD_TRANSLATIONS['en-US'] = {
|
||||
"error": {
|
||||
"saveFailed": "Failed to save coupon"
|
||||
}
|
||||
},
|
||||
"period": {
|
||||
"monthly": "Monthly",
|
||||
"quarterly": "Quarterly",
|
||||
"half_yearly": "Half Yearly",
|
||||
"yearly": "Yearly",
|
||||
"two_yearly": "Two Yearly",
|
||||
"three_yearly": "Three Yearly",
|
||||
"onetime": "One Time",
|
||||
"reset_traffic": "Reset Traffic"
|
||||
}
|
||||
},
|
||||
"notice": {
|
||||
|
10
public/assets/admin/locales/ko-KR.js
vendored
10
public/assets/admin/locales/ko-KR.js
vendored
@ -1219,6 +1219,16 @@ window.XBOARD_TRANSLATIONS['ko-KR'] = {
|
||||
"error": {
|
||||
"saveFailed": "쿠폰 저장 실패"
|
||||
}
|
||||
},
|
||||
"period": {
|
||||
"monthly": "월별",
|
||||
"quarterly": "분기별",
|
||||
"half_yearly": "반년별",
|
||||
"yearly": "연간",
|
||||
"two_yearly": "두 년",
|
||||
"three_yearly": "세 년",
|
||||
"onetime": "한 번",
|
||||
"reset_traffic": "트래픽 재설정"
|
||||
}
|
||||
},
|
||||
"notice": {
|
||||
|
10
public/assets/admin/locales/zh-CN.js
vendored
10
public/assets/admin/locales/zh-CN.js
vendored
@ -1211,6 +1211,16 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = {
|
||||
"error": {
|
||||
"saveFailed": "保存优惠券失败"
|
||||
}
|
||||
},
|
||||
"period": {
|
||||
"monthly": "月",
|
||||
"quarterly": "季度",
|
||||
"half_yearly": "半年",
|
||||
"yearly": "年",
|
||||
"two_yearly": "两年",
|
||||
"three_yearly": "三年",
|
||||
"onetime": "一次性",
|
||||
"reset_traffic": "重置流量"
|
||||
}
|
||||
},
|
||||
"notice": {
|
||||
|
Loading…
Reference in New Issue
Block a user