Store time ranges for index sites.
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\Incoming;
|
||||
use App\Models\Incomingitem;
|
||||
use App\Models\Incomingtax;
|
||||
use App\Models\Option;
|
||||
use App\Models\Supplier;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -17,6 +18,9 @@ class IncomingController extends Controller
|
||||
*/
|
||||
public function index($from = null, $end = null): JsonResponse
|
||||
{
|
||||
Option::updateOrCreate(['name' => 'incoming_from'], ['value' => $from]);
|
||||
Option::updateOrCreate(['name' => 'incoming_end'], ['value' => $end]);
|
||||
|
||||
return response()->json(Incoming::whereBetween('issue_date', [$from, $end])->with(['supplier'])->orderBy('issue_date', 'desc')->get());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user