This commit is contained in:
邓皓元 2019-08-12 14:27:34 +08:00
parent 840349d22e
commit a25e5c02ff
3 changed files with 21 additions and 10 deletions

View File

@ -990,7 +990,7 @@ class OrderService extends Service
foreach ($array as $card) {
$data[$card['sim']] = [
'sim' => $card['sim'],
'counts' => $data[$card['sim']] ? $data[$card['sim']] + $card['counts'] : $card['counts'],
'counts' => $data[$card['sim']] ? $data[$card['sim']]['counts'] + $card['counts'] : $card['counts'],
'type' => $node['type'],
'order_id' => $node['id'],
'company_id' => $node['company_id'],

View File

@ -1,14 +1,11 @@
<?php
use App\Domains\Real\Services\OrderService;
require_once realpath(dirname(__FILE__) . '/TestCase.php');
$res = DB::connection('real')->select("call proc_child('No00000000768')");
$conditions = [
'company_name' = '福建车媒通网络科技有限公司',
'month' = '2016-01'
]
foreach ($res as $key => &$value) {
$value = (array) $value;
}
$res = array_pluck($res, 'custom_no');
dd(in_array('No00000003080', $res));
$export = new CompanyReportExport($conditions);
$url = ExportService::store($export, $this->disk);

14
tests/ProcChildTest.php Normal file
View File

@ -0,0 +1,14 @@
<?php
use App\Domains\Real\Services\OrderService;
require_once realpath(dirname(__FILE__) . '/TestCase.php');
$res = DB::connection('real')->select("call proc_child('No00000000768')");
foreach ($res as $key => &$value) {
$value = (array) $value;
}
$res = array_pluck($res, 'custom_no');
dd(in_array('No00000003080', $res));