44 lines
1.3 KiB
PHP
44 lines
1.3 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
|
|
{
|
|
switch ($action) {
|
|
case 'update':
|
|
return ['product_uid', "cost", "sale", "quantity", "price", "status"];
|
|
break;
|
|
case "index":
|
|
case "excel":
|
|
case "view":
|
|
return ["user_uid", 'product_uid', "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"];
|
|
break;
|
|
default:
|
|
return throw new \Exception("{$action} 해당기능은 없습니다.");
|
|
break;
|
|
}
|
|
}
|
|
final public function getFieldFilters(): array
|
|
{
|
|
return ["user_uid", 'product_uid', "status"];
|
|
}
|
|
final public function getFieldBatchFilters(): array
|
|
{
|
|
return ["status"];
|
|
}
|
|
}
|