同步日志
This commit is contained in:
parent
4fc607f182
commit
2647a4547e
@ -45,6 +45,8 @@ class MongoSyncJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
Log::info("MongoSyncJob #: utcDateTime {$this->utcDateTime} - page {$this->page}");
|
||||||
|
|
||||||
$query = TblCard::select(['cNo', 'bNo', 'iccid', 'imsi', 'comId', 'oType', 'saDate', 'sDate', 'oRDate'])
|
$query = TblCard::select(['cNo', 'bNo', 'iccid', 'imsi', 'comId', 'oType', 'saDate', 'sDate', 'oRDate'])
|
||||||
->where('pNo', 'No00000000768')
|
->where('pNo', 'No00000000768')
|
||||||
->where('oRDate', '>', $this->utcDateTime)
|
->where('oRDate', '>', $this->utcDateTime)
|
||||||
|
@ -4,6 +4,7 @@ namespace App\Domains\Virtual\Exports;
|
|||||||
|
|
||||||
use App\Dicts;
|
use App\Dicts;
|
||||||
use App\Core\AbstractExport;
|
use App\Core\AbstractExport;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Dipper\Excel\Concerns\WithRows;
|
use Dipper\Excel\Concerns\WithRows;
|
||||||
use Dipper\Excel\Concerns\FromQuery;
|
use Dipper\Excel\Concerns\FromQuery;
|
||||||
use Dipper\Excel\Concerns\Exportable;
|
use Dipper\Excel\Concerns\Exportable;
|
||||||
@ -26,7 +27,10 @@ class CardExport extends AbstractExport implements FromQuery, WithHeadings, With
|
|||||||
|
|
||||||
public function query()
|
public function query()
|
||||||
{
|
{
|
||||||
$builder = app(OrderCardRepository::class)->withConditions($this->conditions)->applyConditions();
|
$builder = app(OrderCardRepository::class)->select([
|
||||||
|
'*',
|
||||||
|
DB::raw('timelines_json(sim) as timelines'),
|
||||||
|
])->withConditions($this->conditions)->applyConditions();
|
||||||
|
|
||||||
return $builder;
|
return $builder;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ class CardSyncJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
Log::info("CardSyncJob #: maxId {$this->maxId} - page {$this->page}");
|
||||||
|
|
||||||
$blocs = app(BlocRepository::class)->withTrashed()->get()->pluck('id', 'shorthand')->toArray();
|
$blocs = app(BlocRepository::class)->withTrashed()->get()->pluck('id', 'shorthand')->toArray();
|
||||||
|
|
||||||
$query = DB::connection('vd_old')->table('ckb_custom')
|
$query = DB::connection('vd_old')->table('ckb_custom')
|
||||||
|
@ -71,6 +71,7 @@ class LogSyncJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
Log::info("LogSyncJob #: maxId {$this->maxId} - page {$this->page}");
|
||||||
$this->packages = app(PackageRepository::class)->withTrashed()->get()->keyBy('sn');
|
$this->packages = app(PackageRepository::class)->withTrashed()->get()->keyBy('sn');
|
||||||
$this->products = app(ProductRepository::class)->withTrashed()->get()->keyBy('sn');
|
$this->products = app(ProductRepository::class)->withTrashed()->get()->keyBy('sn');
|
||||||
$this->companies = app(CompanyRepository::class)->withTrashed()->get()->keyBy('sn');
|
$this->companies = app(CompanyRepository::class)->withTrashed()->get()->keyBy('sn');
|
||||||
|
@ -67,12 +67,16 @@ class CardService extends Service
|
|||||||
|
|
||||||
$_timelines = json_decode($item->timelines, true);
|
$_timelines = json_decode($item->timelines, true);
|
||||||
|
|
||||||
foreach ($_timelines as &$timeline) {
|
try{
|
||||||
$package = app(PackageService::class)->load($timeline['package_id']);
|
foreach ($_timelines as &$timeline) {
|
||||||
$timeline['type_name'] = self::$typeNames[$timeline['type']];
|
$package = app(PackageService::class)->load($timeline['package_id']);
|
||||||
$timeline['name'] = $package['name'];
|
$timeline['type_name'] = self::$typeNames[$timeline['type']];
|
||||||
$timeline['service_start_at'] = Carbon::parse($timeline['service_start_at'])->format('Y-m');
|
$timeline['name'] = $package['name'];
|
||||||
$timeline['service_end_at'] = Carbon::parse($timeline['service_end_at'])->format('Y-m');
|
$timeline['service_start_at'] = Carbon::parse($timeline['service_start_at'])->format('Y-m');
|
||||||
|
$timeline['service_end_at'] = Carbon::parse($timeline['service_end_at'])->format('Y-m');
|
||||||
|
}
|
||||||
|
}catch(\Exception $e){
|
||||||
|
dd($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
$company = app(CompanyService::class)->load($item->company_id);
|
$company = app(CompanyService::class)->load($item->company_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user