流量池修改
This commit is contained in:
parent
107bdbcf82
commit
d621cf6520
@ -343,7 +343,7 @@ class FlowPoolController extends Controller
|
|||||||
'month' => substr_replace($month, '-', 4, 0),
|
'month' => substr_replace($month, '-', 4, 0),
|
||||||
])->get()->pluck('package_id', 'sim')->toArray();
|
])->get()->pluck('package_id', 'sim')->toArray();
|
||||||
|
|
||||||
foreach ($news as $item) {
|
foreach ($news as $key => $item) {
|
||||||
if (!isset($cards[$item['sim']])) {
|
if (!isset($cards[$item['sim']])) {
|
||||||
throw new NotExistException('卡服务周期不正确或不存在 #:' . $item['sim']);
|
throw new NotExistException('卡服务周期不正确或不存在 #:' . $item['sim']);
|
||||||
}
|
}
|
||||||
@ -353,6 +353,8 @@ class FlowPoolController extends Controller
|
|||||||
if (!in_array($cards[$item['sim']], $pool['package_ids'])) {
|
if (!in_array($cards[$item['sim']], $pool['package_ids'])) {
|
||||||
throw new InvalidArgumentException("卡不属于流量池 {$item['pool_id']} #: {$item['sim']}");
|
throw new InvalidArgumentException("卡不属于流量池 {$item['pool_id']} #: {$item['sim']}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$news[$key]['package_id'] = $cards[$item['sim']];
|
||||||
}
|
}
|
||||||
|
|
||||||
app(FlowPoolMonth::class)->setTable($table)->upsert($news, ['sim', 'month']);
|
app(FlowPoolMonth::class)->setTable($table)->upsert($news, ['sim', 'month']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user