bourse stock
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.

56 lines
1.8 KiB

3 months ago
<?php
namespace app\admin\controller\setting;
use app\admin\controller\AdminBaseController;
use app\admin\service\setting\GiveHkdStockService;
use app\admin\service\setting\GiveIdnStockService;
use app\admin\service\setting\GiveInStockService;
use app\admin\service\setting\GiveMysStockService;
use app\admin\service\setting\GiveSgdStockService;
use app\admin\service\setting\GiveStockService;
use app\admin\service\setting\GiveThaStockService;
use app\admin\service\setting\GiveUsStockService;
use app\model\StockMarketModel;
// 送股
class GiveStock extends AdminBaseController
{
// 列表
public function index()
{
try {
$param = $this->request->param();
if (empty($param['market_type'])) {
$result = [
'code' => 0,
'message' => 'SUCCESS',
'data' => ['total' => 0, 'list' => [], 'extent' => StockMarketModel::STOCK_MARKET_TYPE]
];
return json($result);
}
$result = (new GiveStockService)->index($param['market_type'], $param, $this->getAdminId());
return json($result);
} catch (\Exception $exception) {
return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage()]);
}
}
// 新增
public function add()
{
try {
$param = $this->request->param();
if (empty($param['market_type'])) return json([]);
$result = (new GiveStockService)->add($param['market_type'], $param);
return json($result);
} catch (\Exception $exception) {
return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage()]);
}
}
}