47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin;
|
|
|
|
use App\Models\BillingModel;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class BillingController extends AdminController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->_model = new BillingModel();
|
|
$this->_viewDatas['className'] = 'Billing';
|
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
|
helper($this->_viewDatas['className']);
|
|
}
|
|
|
|
final public function getFields(string $action = ""): array
|
|
{
|
|
switch ($action) {
|
|
case "index":
|
|
case "excel":
|
|
return ["email", "phone", "title", "upload_file", "status", "updated_at", "created_at"];
|
|
break;
|
|
case "view":
|
|
return ["user_uid", 'order_uid', "email", "phone", "title", "upload_file", "status", "updated_at", "created_at", 'response'];
|
|
break;
|
|
default:
|
|
return [];
|
|
break;
|
|
}
|
|
}
|
|
final public function getFieldFilters(): array
|
|
{
|
|
return ["user_uid", 'order_uid', "status"];
|
|
}
|
|
final public function getFieldBatchFilters(): array
|
|
{
|
|
return ["status"];
|
|
}
|
|
}
|