generated from liutk/owl-admin-base
Fix
parent
987c921052
commit
f237b091e1
|
|
@ -6,6 +6,7 @@ use App\Exceptions\RuntimeException;
|
|||
use App\Models\Keyword;
|
||||
use App\Models\Ledger;
|
||||
use App\Models\LedgerItem;
|
||||
use App\Models\Store;
|
||||
use App\Models\TaskLedger;
|
||||
use App\Models\TaskPerformance;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -199,15 +200,19 @@ class LedgerController extends Controller
|
|||
|
||||
$storeId = $request->whenFilled('store_id', fn ($storeId) => $storeId, fn () => $user->store_id);
|
||||
|
||||
if (is_null($store = Store::find($storeId))) {
|
||||
throw new RuntimeException('门店未找到');
|
||||
}
|
||||
|
||||
/** @var \App\Models\Ledger|null */
|
||||
$ledger = Ledger::with(['items'])
|
||||
->where('store_id', $storeId)
|
||||
->where('store_id', $store->id)
|
||||
->where('date', $date)
|
||||
->first();
|
||||
|
||||
$items = [];
|
||||
|
||||
if ($user->store?->isLotteryStore()) {
|
||||
if ($store->isLotteryStore()) {
|
||||
/** @var \Illuminate\Database\Eloquent\Collection */
|
||||
$lotteryTypes = Keyword::filter(['parent_key' => 'lottery_type'])
|
||||
->oldest('sort')
|
||||
|
|
|
|||
Loading…
Reference in New Issue