shoppingmallv2/app/Controllers/Admin/OrderController.php
최준흠git config git config --helpgit config --global user.name 최준흠 a0c66ee3ec shoppingmallv2 init...
2023-08-04 23:19:19 +09:00

42 lines
1.2 KiB
PHP

<?php
namespace App\Controllers\Admin;
use App\Models\OrderModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class OrderController extends AdminController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->_model = new OrderModel();
parent::initController($request, $response, $logger);
$this->_viewPath .= strtolower($this->_model->getClassName());
}
final public function getFields(string $action = ""): array
{
$fields = ["user_uid", 'product_uid', "quantity", "price", "status"];
switch ($action) {
case "index":
case "excel":
case "view":
return ["user_uid", 'product_uid', "name", "quantity", "price", "status", "updated_at", "created_at"];
break;
default:
return $fields;
break;
}
}
final public function getFieldFilters(): array
{
return ["user_uid", 'product_uid', "status"];
}
final public function getFieldBatchFilters(): array
{
return ["status"];
}
}