Files
lgp-admin-plus-api/app/Http/Controllers/Api/EnterpriseController.php
LQ bcf54c2727 初始化
缺陷:主题配色需要优化整体的同风格
2026-08-14 23:21:21 +08:00

39 lines
984 B
PHP

<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\business\EnterpriseService;
use Exception;
use Illuminate\Http\JsonResponse;
/**
* 企业管理
*/
class EnterpriseController extends BaseController
{
public function __construct()
{
parent::__construct();
$this->service = EnterpriseService::getInstance();
$this->insertField = ['name'];
$this->updateField = ['id', 'name'];
$this->notRequest = [
'logo', 'contact_name', 'phone', 'address',
'tax_no', 'settle_type', 'price_number', 'status', 'remark',
];
}
/**
* 启用 / 禁用
* @Method POST
* @throws Exception
*/
public function status(): JsonResponse
{
$this->insertField = ['id', 'status'];
$params = $this->checkRequiredFields(request()->post());
return jok($this->service->status($params['id'], $params['status']), '操作成功');
}
}