feat : coupon

This commit is contained in:
2025-03-18 17:43:46 +08:00
parent c7b667dc61
commit 67dc58e90b
5 changed files with 101 additions and 22 deletions

View File

@@ -22,7 +22,8 @@ use Hyperf\DbConnection\Model\Model;
* @property string $appoint_value
* @property string $use_scene_ids
* @property int $validity_time_type
* @property string $validity_time_value
* @property string $validity_time_value
* @property int $status
* @property string $remark
* @property string $create_time
* @property string $update_time
@@ -43,7 +44,7 @@ class CouponDispenseLog extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'coupon_template_id' => 'integer', 'send_count' => 'integer', 'receive_count' => 'integer', 'left_count' => 'integer', 'item_count' => 'integer', 'appoint_group' => 'integer', 'claim_rule' => 'integer', 'appoint_city_id' => 'integer', 'validity_time_type' => 'integer'];
protected array $casts = ['id' => 'integer', 'coupon_template_id' => 'integer', 'send_count' => 'integer', 'receive_count' => 'integer', 'left_count' => 'integer', 'item_count' => 'integer', 'appoint_group' => 'integer', 'claim_rule' => 'integer', 'appoint_city_id' => 'integer', 'validity_time_type' => 'integer','status' => 'integer'];
const string CREATED_AT = 'create_time';
const string UPDATED_AT = 'update_time';
@@ -85,12 +86,14 @@ class CouponDispenseLog extends Model
->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();