Finalizacion de la primera version del proyecto
This commit is contained in:
30
app/Models/CajaMovimiento.php
Normal file
30
app/Models/CajaMovimiento.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CajaMovimiento extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CODIGO_CAJA = 1, CODIGO_RETIRO = 2;
|
||||
|
||||
protected $fillable = [
|
||||
'cantidad',
|
||||
'estado_caja_movimiento_id',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
|
||||
public static function cajaInicial()
|
||||
{
|
||||
return CajaMovimiento::where([
|
||||
['user_id','=',auth()->user()->id],
|
||||
['created_at', '>=', Carbon::now()->startOfDay()],
|
||||
['created_at', '<=', Carbon::now()->endOfDay()],
|
||||
])->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user