条件错误排查
This commit is contained in:
parent
1c1fc8976c
commit
840349d22e
@ -37,7 +37,7 @@ class CompanySync extends Command
|
||||
$array = [];
|
||||
|
||||
foreach ($data as $item) {
|
||||
$item = (array)$item;
|
||||
$item = (array) $item;
|
||||
$item['name'] = trim($item['name']);
|
||||
$item['created_at'] = is_numeric($item['created_at']) ? Carbon::createFromTimestamp($item['created_at']) : Carbon::parse($item['created_at']);
|
||||
$item['updated_at'] = is_numeric($item['updated_at']) ? Carbon::createFromTimestamp($item['updated_at']) : Carbon::parse($item['updated_at']);
|
||||
|
@ -988,9 +988,9 @@ class OrderService extends Service
|
||||
$data = [];
|
||||
|
||||
foreach ($array as $card) {
|
||||
$data[] = [
|
||||
$data[$card['sim']] = [
|
||||
'sim' => $card['sim'],
|
||||
'counts' => $card['counts'],
|
||||
'counts' => $data[$card['sim']] ? $data[$card['sim']] + $card['counts'] : $card['counts'],
|
||||
'type' => $node['type'],
|
||||
'order_id' => $node['id'],
|
||||
'company_id' => $node['company_id'],
|
||||
@ -1005,6 +1005,8 @@ class OrderService extends Service
|
||||
return;
|
||||
}
|
||||
|
||||
$data = array_values($data);
|
||||
|
||||
foreach (array_chunk($data, 1000) as $value) {
|
||||
if ($table === 'virtual_order_cards' && DB::table($table)->whereIn('sim', array_pluck($value, 'sim'))->whereNull('deleted_at')->count()) {
|
||||
throw new ExistedException('出现重复销售卡');
|
||||
|
@ -4,8 +4,11 @@ use App\Domains\Real\Services\OrderService;
|
||||
|
||||
require_once realpath(dirname(__FILE__) . '/TestCase.php');
|
||||
|
||||
$service = app(OrderService::class);
|
||||
$res = DB::connection('real')->select("call proc_child('No00000000768')");
|
||||
|
||||
$res = $service->index(['type' => 2, 'id' => 253371]);
|
||||
foreach ($res as $key => &$value) {
|
||||
$value = (array) $value;
|
||||
}
|
||||
|
||||
dd($res);
|
||||
$res = array_pluck($res, 'custom_no');
|
||||
dd(in_array('No00000003080', $res));
|
||||
|
Loading…
x
Reference in New Issue
Block a user