Files
coolcoth.com/app/Controllers/PSI/StockController.php
T
2026-08-08 15:53:53 +08:00

24 lines
727 B
PHP

<?php
namespace App\Controllers\PSI;
use App\Controllers\Controller;
use App\Models\PSI\StockMove;
use App\Models\PSI\Material;
use App\Models\PSI\Product;
/** 库存流水台账(所有出入库变动记录) */
class StockController extends Controller
{
public function index()
{
$moves = (new StockMove())->all();
$moves = array_reverse($moves);
$nameMap = [];
foreach ((new Material())->all() as $m) { $nameMap['material:' . $m['id']] = $m['name']; }
foreach ((new Product())->all() as $p) { $nameMap['product:' . $p['id']] = $p['name']; }
return $this->renderSubsys('psi', 'psi/stock', ['moves' => $moves, 'nameMap' => $nameMap], \psi_nav(), 'stock');
}
}