39 lines
984 B
PHP
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']), '操作成功');
|
|
}
|
|
}
|