You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\controller\api;
|
|
|
|
use app\service\invoice\InvoiceIssuanceService;
|
|
use app\service\webService\FeeService;
|
|
use fast\FuncException;
|
|
|
|
class Test extends Base
|
|
{
|
|
|
|
public function index()
|
|
{
|
|
try {
|
|
|
|
$data = [
|
|
'pucode' => '',
|
|
'expire_time' => '',
|
|
'id' => ''
|
|
];
|
|
|
|
$InvoiceIssuanceService = new InvoiceIssuanceService();
|
|
|
|
$result = $InvoiceIssuanceService->IssueAnInvoice($data);
|
|
|
|
if ($result !== true) {
|
|
throw new FuncException($result);
|
|
}
|
|
} catch (\Exception $e) {
|
|
dump($e);die;
|
|
}
|
|
}
|
|
|
|
|
|
public function getWechatData()
|
|
{
|
|
$pucode = '41108008';
|
|
$FeeService = new FeeService($pucode);
|
|
return $FeeService->getUsers();
|
|
}
|
|
|
|
public function apiInvoiceIssuance()
|
|
{
|
|
try {
|
|
$param = $this->request->param();
|
|
$data = (new \app\service\invoice\TempInvoiceService())->IssueAnInvoice($param);
|
|
return $this->buildSuccess($data);
|
|
} catch (\Exception $e) {
|
|
return $this->buildFailed(0, $e->getMessage());
|
|
}
|
|
}
|
|
}
|
|
|