|
@@ -33,7 +33,7 @@ class CardBatchService
|
|
|
$model = new CardBatch();
|
|
|
$model->join_card_batch_user_id = $params['join_card_batch_user_id']; // 批次创建用户 user_id
|
|
|
$model->join_card_batch_category_id = $params['join_card_batch_category_id']; // 批次卡分类ID
|
|
|
- $model->card_batch_status = $model::CARD_BATCH_STATUS[$params['card_batch_status']]; // 批次状态
|
|
|
+ $model->card_batch_status = $params['card_batch_status']; // 批次状态
|
|
|
$model->card_batch_category = $params['card_batch_category'] ?? "NORMAL"; // 批次类型 NORMAL
|
|
|
$model->card_batch_name = $params['card_batch_name']; // 卡批次名称
|
|
|
$model->card_batch_prefix = $params['card_batch_prefix']; // 卡批次前缀
|
|
@@ -86,7 +86,7 @@ class CardBatchService
|
|
|
$cardBatchModel = new CardBatch();
|
|
|
$model = $cardBatchModel::find($params['card_batch_id']);
|
|
|
$model->card_batch_name = $params['card_batch_name'];
|
|
|
- $params['card_batch_status'] = $model->card_batch_status = $cardBatchModel::CARD_BATCH_STATUS[$params['card_batch_status']]; // 批次状态
|
|
|
+ $params['card_batch_status'] = $model->card_batch_status = $params['card_batch_status']; // 批次状态
|
|
|
if ($params['validtimes_status'] == 0) {
|
|
|
$model->card_batch_validtimes = 0; // 卡批次有效期 0=永久 天
|
|
|
} elseif ($params['validtimes_status'] == 1) {
|
|
@@ -105,7 +105,7 @@ class CardBatchService
|
|
|
$model = new Card();
|
|
|
$data['card_name'] = $params['card_batch_name'];
|
|
|
|
|
|
- $card_status = array_values($model::CARD_STATUS);
|
|
|
+ $card_status = array_keys($model::CARD_STATUS);
|
|
|
if (in_array($params['card_batch_status'], $card_status)) {
|
|
|
$data['card_status'] = $params['card_batch_status']; // 卡批次状态
|
|
|
}
|
|
@@ -256,7 +256,7 @@ class CardBatchService
|
|
|
$card_status_total = array_column($card_status_total, null, 'join_card_batch_id');
|
|
|
foreach ($rows as $key => &$value) {
|
|
|
$value['card_batch_status_value'] = $value['card_batch_status'];
|
|
|
- $value['card_batch_status'] = array_flip($cardBatchModel::CARD_BATCH_STATUS)[$value['card_batch_status']];
|
|
|
+ $value['card_batch_status'] = $cardBatchModel::CARD_BATCH_STATUS[$value['card_batch_status']];
|
|
|
!empty($value['card_batch_json']) && $value['card_batch_json'] = json_decode($value['card_batch_json'], true);
|
|
|
!empty($value['card_batch_extend_json']) && $value['card_batch_extend_json'] = json_decode($value['card_batch_extend_json'], true);
|
|
|
// 合并储值卡面值以及状态数量
|