shoppingmallv2/app/Controllers/Admin/OrderController.php
최준흠git config git config --helpgit config --global user.name 최준흠 e96de32a6c shoppingmallv2 init...
2023-08-01 21:52:02 +09:00

45 lines
1.4 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
{
private $_product_options = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->_model = new OrderModel($this->getFields());
parent::initController($request, $response, $logger);
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
helper($this->_model->getClassName());
}
final public function getFields(string $action = ""): array
{
$fields = ['product_uid', "quantity", "price", "status"];
switch ($action) {
case "index":
case "excel":
case "view":
return ['product_uid', "user_uid", "quantity", "price", "status", "updated_at", "created_at"];
break;
default:
return $fields;
break;
}
}
final public function getFieldFilters(): array
{
return ['product_uid', "user_uid", "status"];
}
final public function getFieldBatchFilters(): array
{
return ["status"];
}
}