123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
-
- namespace app\api\controller;
-
-
- use app\api\logic\OrderInvoiceLogic;
- use app\api\validate\OrderInvoiceValidate;
- use app\common\basics\Api;
- use app\common\server\JsonServer;
-
-
-
- class OrderInvoice extends Api
- {
-
-
-
- public function add()
- {
- $post = $this->request->post();
- $params = (new OrderInvoiceValidate())->goCheck('add', $post);
- $result = OrderInvoiceLogic::add($params);
- if (false === $result) {
- $error = OrderInvoiceLogic::getError() ?: '提交失败';
- return JsonServer::error($error);
- }
- return JsonServer::success('提交成功', [], 1, 1);
- }
-
-
-
-
-
- public function edit()
- {
- $post = $this->request->post();
- $params = (new OrderInvoiceValidate())->goCheck('edit', $post);
- $result = OrderInvoiceLogic::edit($params);
- if (false === $result) {
- $error = OrderInvoiceLogic::getError() ?: '编辑失败';
- return JsonServer::error($error);
- }
- return JsonServer::success('操作成功', [], 1, 1);
- }
-
-
-
-
-
- public function detail()
- {
- $params = (new OrderInvoiceValidate())->goCheck('detail');
- $result = OrderInvoiceLogic::detail($params);
- return JsonServer::success('获取成功', $result);
- }
-
-
-
-
- public function setting()
- {
- $params = (new OrderInvoiceValidate())->goCheck('setting');
- $result = OrderInvoiceLogic::getInvoiceSetting($params);
- return JsonServer::success('获取成功', $result);
- }
-
- }
|