mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 20:17:32 +08:00
fix(coupon): correct knows issues
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Services\PlanService;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Coupon extends Model
|
||||
@@ -15,4 +16,11 @@ class Coupon extends Model
|
||||
'limit_plan_ids' => 'array',
|
||||
'limit_period' => 'array'
|
||||
];
|
||||
|
||||
public function getLimitPeriodAttribute($value)
|
||||
{
|
||||
return collect(json_decode($value, true))->map(function ($item) {
|
||||
return PlanService::getPeriodKey($item);
|
||||
})->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user