feat : coupon

This commit is contained in:
2025-03-19 11:23:54 +08:00
parent 67dc58e90b
commit 785d27fe7b
5 changed files with 329 additions and 136 deletions

View File

@@ -82,25 +82,22 @@ class CouponDispenseLog extends Model
*/
public function getNoReceiveCount(): array
{
$all = $this
return $this
->where('claim_rule',CouponCode::DISPENSE_CLAIM_RULE_HOME_POPUPS)
->whereColumn('total_count','!=','receive_count')
->where('appoint_group',CouponCode::DISPENSE_APPOINT_GROUP_ALL_PEOPLE)
->where('status',CouponCode::DISPENSE_VALIDITY)
->pluck('id')
->toArray();
}
$appoint = $this
->where('claim_rule',CouponCode::DISPENSE_CLAIM_RULE_HOME_POPUPS)
->where('appoint_group','!=',CouponCode::DISPENSE_APPOINT_GROUP_ALL_PEOPLE)
->where('status',CouponCode::DISPENSE_VALIDITY)
->pluck('id')
->toArray();
return [
'all' => $all,
'appoint' => $appoint
];
/**
* @param array $ids
* @return Collection
*/
public function getInfoByIds(array $ids)
{
return $this->whereIn('id',$ids)->get();
}
}