|
@@ -166,28 +166,27 @@ class TestController extends Controller
|
|
|
|
|
|
|
|
public function test()
|
|
public function test()
|
|
|
{
|
|
{
|
|
|
- $ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();
|
|
|
|
|
- $owners = Owner::query()->whereNotIn("id",array_column($ows->toArray(),"owner_id"))->get();
|
|
|
|
|
- dd($owners);
|
|
|
|
|
return view("test");
|
|
return view("test");
|
|
|
}
|
|
}
|
|
|
public function supplementMarchOwnerReport()
|
|
public function supplementMarchOwnerReport()
|
|
|
{
|
|
{
|
|
|
$ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();
|
|
$ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();
|
|
|
$owners = Owner::query()->whereNotIn("id",array_column($ows->toArray(),"owner_id"))->get();
|
|
$owners = Owner::query()->whereNotIn("id",array_column($ows->toArray(),"owner_id"))->get();
|
|
|
|
|
+ $createOwnerAreaReport = [];
|
|
|
foreach ($owners as $owner){
|
|
foreach ($owners as $owner){
|
|
|
if (!$owner->ownerStoragePriceModels)continue;
|
|
if (!$owner->ownerStoragePriceModels)continue;
|
|
|
foreach ($owner->ownerStoragePriceModels as $model){
|
|
foreach ($owner->ownerStoragePriceModels as $model){
|
|
|
$key = $owner->id."_".$model->id;
|
|
$key = $owner->id."_".$model->id;
|
|
|
if (!isset($sign[$key])) $createOwnerAreaReport[] = [
|
|
if (!isset($sign[$key])) $createOwnerAreaReport[] = [
|
|
|
"owner_id" => $owner->id,
|
|
"owner_id" => $owner->id,
|
|
|
- "counting_month" => 1,
|
|
|
|
|
|
|
+ "counting_month" => "2021-03-01",
|
|
|
"user_owner_group_id" => $owner->user_owner_group_id,
|
|
"user_owner_group_id" => $owner->user_owner_group_id,
|
|
|
- "created_at" => 1,
|
|
|
|
|
|
|
+ "created_at" => "2021-04-15 00:00:00",
|
|
|
"owner_storage_price_model_id" => $model->id,
|
|
"owner_storage_price_model_id" => $model->id,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($createOwnerAreaReport)DB::table("owner_area_reports")->insert($createOwnerAreaReport);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function assignBatch()
|
|
public function assignBatch()
|