mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Modificado el sistema Toast por el popErrorAlert() que integramos
This commit is contained in:
@ -17,20 +17,59 @@ class Test extends BaseController
|
||||
|
||||
public function index()
|
||||
{
|
||||
$model = model('App\Models\Clientes\ClientePreciosModel') ;
|
||||
echo '<pre>';
|
||||
var_dump($model->update_from_plantilla(5));
|
||||
echo '</pre>';
|
||||
/*
|
||||
echo '<pre>';
|
||||
$model = model('App\Models\Clientes\ClientePreciosModel');
|
||||
$configuracion = (object)[
|
||||
'tipo' => 'interior',
|
||||
'tipo_maquina' => 'inkjet',
|
||||
'tipo_impresion' => 'color'
|
||||
];
|
||||
var_dump($model->get_precio_hora(999,$configuracion, 1.5));
|
||||
echo '</pre>';*/
|
||||
|
||||
$this->asignar_tarifa_defecto_todos_usuarios();
|
||||
|
||||
}
|
||||
|
||||
private function asignar_tarifa_defecto_todos_usuarios()
|
||||
{
|
||||
|
||||
// Previo a ejecutar, vaciar la tabla clientes_precios (ojo si hay customizaciones)
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
$builder = $db->table('cliente_precios');
|
||||
|
||||
$plantillaDefectoId = 5;
|
||||
$clienteModel = model('App\Models\Clientes\ClienteModel');
|
||||
$platillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||
|
||||
$plantillaDefecto = $platillaModel->getResource($plantillaDefectoId)->get()->getResultObject();
|
||||
|
||||
$clientes = $clienteModel->getResource()->get()->getResultObject();
|
||||
|
||||
foreach ($clientes as $cliente){
|
||||
|
||||
foreach ($plantillaDefecto as $plantillaDefectoLinea){
|
||||
|
||||
$data = [
|
||||
'plantilla_id' => $plantillaDefectoId,
|
||||
'cliente_id' => $cliente->id,
|
||||
'tipo' => $plantillaDefectoLinea->tipo,
|
||||
'tipo_maquina' => $plantillaDefectoLinea->tipo_maquina,
|
||||
'tipo_impresion' => $plantillaDefectoLinea->tipo_impresion,
|
||||
'tiempo_min' => $plantillaDefectoLinea->tiempo_min,
|
||||
'tiempo_max' => $plantillaDefectoLinea->tiempo_max,
|
||||
'precio_hora' => $plantillaDefectoLinea->precio_hora,
|
||||
'margen' => $plantillaDefectoLinea->margen,
|
||||
'user_created_id' => 2,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
|
||||
/*echo '<pre>';
|
||||
var_dump($data);
|
||||
echo '</pre>';*/
|
||||
|
||||
$builder->insert($data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user