|
@@ -56,11 +56,10 @@ class CardService
|
|
|
$rand = $demandConfig['rand'] ?? 0;
|
|
|
$begin = $demandConfig['begin'] ?? 1;
|
|
|
if (!empty($lastCard)) {
|
|
|
- $oldCardId = (string)$lastCard->card_id;dump('1>>>'.$oldCardId);
|
|
|
- $oldCardId = ltrim($oldCardId, $demandConfig['prefix']);dump('2>>>'.$oldCardId);
|
|
|
- $oldCardId = rtrim($oldCardId, $demandConfig['suffix']);dump('3>>>'.$oldCardId);
|
|
|
- $oldCardId = ltrim($oldCardId, $rand);dump('4>>>'.$oldCardId);
|
|
|
- $number = intval($oldCardId) + 1;dump('5>>>'.$oldCardId);
|
|
|
+ $oldCardId = $lastCard->card_id;
|
|
|
+ $oldCardId = substr($oldCardId, strripos($oldCardId, $demandConfig['prefix']) + $prefixLength);
|
|
|
+ $oldCardId = substr($oldCardId, 0, strrpos($oldCardId, $demandConfig['suffix']));
|
|
|
+ $number = intval($oldCardId) + 1;
|
|
|
} else {
|
|
|
$number = $begin;
|
|
|
}
|
|
@@ -241,7 +240,7 @@ class CardService
|
|
|
|
|
|
$goodsIds = Goods::whereIn('join_goods_category_id', $categoryId)->pluck('goods_id')->toArray();
|
|
|
|
|
|
- return array_unique(array_merge($goodsId,$goodsIds));
|
|
|
+ return array_unique(array_merge($goodsId, $goodsIds));
|
|
|
}
|
|
|
|
|
|
public static $status = [
|