Commit a9d677a9 authored by shajiaiming's avatar shajiaiming

币信息增加可选简称

parent 2f8da1bb
...@@ -131,7 +131,7 @@ class CoinController extends BaseController ...@@ -131,7 +131,7 @@ class CoinController extends BaseController
if ($recommend) { if ($recommend) {
$condition['recommend'] = $recommend; $condition['recommend'] = $recommend;
} }
$select = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain', 'treaty']; $select = ['id', 'sid', 'icon', 'name', 'optional_name', 'nickname', 'platform', 'chain', 'treaty'];
$order_by = ['sort' => SORT_ASC]; $order_by = ['sort' => SORT_ASC];
$datas = CoinRecommend::getList($page, $limit, $condition, $order_by, $select); $datas = CoinRecommend::getList($page, $limit, $condition, $order_by, $select);
//获取详细信息 //获取详细信息
......
...@@ -32,12 +32,12 @@ class CoinController extends BaseController ...@@ -32,12 +32,12 @@ class CoinController extends BaseController
public function actionIndex() public function actionIndex()
{ {
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
$request = Yii::$app->request; $request = Yii::$app->request;
$page = $request->get('page', 1); $page = $request->get('page', 1);
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
$name = $request->get('name', null); $name = $request->get('name', null);
$platform = $request->get('platform', ''); $platform = $request->get('platform', '');
$chain = $request->get('chain', ''); $chain = $request->get('chain', '');
$recommend = $request->get('recommend', ''); $recommend = $request->get('recommend', '');
$condition = []; $condition = [];
...@@ -69,7 +69,7 @@ class CoinController extends BaseController ...@@ -69,7 +69,7 @@ class CoinController extends BaseController
} }
$platforms = Coin::getPlatformList(); $platforms = Coin::getPlatformList();
$chains = Coin::getChainList(); $chains = Coin::getChainList();
return $this->render('index', ['platforms' => $platforms,'chains' => $chains]); return $this->render('index', ['platforms' => $platforms, 'chains' => $chains]);
} }
/** /**
...@@ -78,7 +78,7 @@ class CoinController extends BaseController ...@@ -78,7 +78,7 @@ class CoinController extends BaseController
*/ */
public function actionAdd() public function actionAdd()
{ {
$model = new CoinForm(); $model = new CoinForm();
$model->scenario = 'add'; $model->scenario = 'add';
if (Yii::$app->request->isPost) { if (Yii::$app->request->isPost) {
$request = Yii::$app->request; $request = Yii::$app->request;
...@@ -89,6 +89,9 @@ class CoinController extends BaseController ...@@ -89,6 +89,9 @@ class CoinController extends BaseController
$coin = Yii::createObject(Coin::className()); $coin = Yii::createObject(Coin::className());
$data = array_merge($request->post(), ['platform_id' => Yii::$app->user->identity->platform_id]); $data = array_merge($request->post(), ['platform_id' => Yii::$app->user->identity->platform_id]);
unset($data['id']); unset($data['id']);
if (isset($data['optional_name'])) {
$data['optional_name'] = strtoupper($data['optional_name']);
}
$data['name'] = strtoupper($data['name']); $data['name'] = strtoupper($data['name']);
$data['platform'] = strtolower($data['platform']); $data['platform'] = strtolower($data['platform']);
$data['chain'] = strtoupper($data['chain']); $data['chain'] = strtoupper($data['chain']);
...@@ -101,10 +104,10 @@ class CoinController extends BaseController ...@@ -101,10 +104,10 @@ class CoinController extends BaseController
$introduce_arr = $data['introduce']; $introduce_arr = $data['introduce'];
$nickname = []; $nickname = [];
$introduce = []; $introduce = [];
foreach ($nickname_arr as $key => $val){ foreach ($nickname_arr as $key => $val) {
$nickname[$lang[$key]] = $val; $nickname[$lang[$key]] = $val;
} }
foreach ($introduce_arr as $key => $val){ foreach ($introduce_arr as $key => $val) {
$introduce[$lang[$key]] = $val; $introduce[$lang[$key]] = $val;
} }
unset($data['nickname']); unset($data['nickname']);
...@@ -139,13 +142,16 @@ class CoinController extends BaseController ...@@ -139,13 +142,16 @@ class CoinController extends BaseController
{ {
if (Yii::$app->request->isPost) { if (Yii::$app->request->isPost) {
$model = new CoinForm(); $model = new CoinForm();
$model->scenario = 'update'; $model->scenario = 'update';
$req = Yii::$app->request; $req = Yii::$app->request;
$data = $req->post(); $data = $req->post();
$data['name'] = strtoupper($data['name']); $data['name'] = strtoupper($data['name']);
$data['platform'] = strtolower($data['platform']); $data['platform'] = strtolower($data['platform']);
$data['chain'] = strtoupper($data['chain']); $data['chain'] = strtoupper($data['chain']);
if (isset($data['optional_name'])) {
$data['optional_name'] = strtoupper($data['optional_name']);
}
Yii::$app->response->format = 'json'; Yii::$app->response->format = 'json';
if ($model->load($data) && $model->validate()) { if ($model->load($data) && $model->validate()) {
$platform_id = Yii::$app->user->identity->platform_id; $platform_id = Yii::$app->user->identity->platform_id;
...@@ -170,16 +176,16 @@ class CoinController extends BaseController ...@@ -170,16 +176,16 @@ class CoinController extends BaseController
$introduce_arr = $data['introduce']; $introduce_arr = $data['introduce'];
$nickname = []; $nickname = [];
$introduce = []; $introduce = [];
foreach ($nickname_arr as $key => $val){ foreach ($nickname_arr as $key => $val) {
$nickname[$lang[$key]] = $val; $nickname[$lang[$key]] = $val;
} }
foreach ($introduce_arr as $key => $val){ foreach ($introduce_arr as $key => $val) {
$introduce[$lang[$key]] = $val; $introduce[$lang[$key]] = $val;
} }
unset($data['nickname']); unset($data['nickname']);
$data['nickname'] = $nickname; $data['nickname'] = $nickname;
$data['introduce'] = $introduce; $data['introduce'] = $introduce;
$coin = Yii::createObject(Coin::className()); $coin = Yii::createObject(Coin::className());
$result = $coin->updateOne($data); $result = $coin->updateOne($data);
if ($result === true) { if ($result === true) {
return ['code' => 0, 'msg' => 'succeed']; return ['code' => 0, 'msg' => 'succeed'];
...@@ -201,7 +207,7 @@ class CoinController extends BaseController ...@@ -201,7 +207,7 @@ class CoinController extends BaseController
} elseif (Yii::$app->request->isGet) { } elseif (Yii::$app->request->isGet) {
$id = Yii::$app->request->get('id', null); $id = Yii::$app->request->get('id', null);
if ($id) { if ($id) {
$coin = Coin::findOne(['id' => $id]); $coin = Coin::findOne(['id' => $id]);
$this->layout = false; $this->layout = false;
return $this->render('edit', ['model' => $coin]); return $this->render('edit', ['model' => $coin]);
} }
...@@ -241,17 +247,17 @@ class CoinController extends BaseController ...@@ -241,17 +247,17 @@ class CoinController extends BaseController
public function actionDelete() public function actionDelete()
{ {
Yii::$app->response->format = 'json'; Yii::$app->response->format = 'json';
$id = Yii::$app->request->get('id', 0); $id = Yii::$app->request->get('id', 0);
if ($id) { if ($id) {
$coin_recommend = CoinRecommend::find()->where(['cid' => $id])->one(); $coin_recommend = CoinRecommend::find()->where(['cid' => $id])->one();
if($coin_recommend){ if ($coin_recommend) {
return ['code' => -1, 'msg' => '推荐币种里有改币种,无法删除']; return ['code' => -1, 'msg' => '推荐币种里有改币种,无法删除'];
} }
$model = Coin::findOne(['id' => $id]); $model = Coin::findOne(['id' => $id]);
if ($model) { if ($model) {
$platform_id = Yii::$app->user->identity->platform_id; $platform_id = Yii::$app->user->identity->platform_id;
$can = false; $can = false;
if (Yii::$app->params['admin'] != Yii::$app->user->id) { if (Yii::$app->params['admin'] != Yii::$app->user->id) {
$coin = Coin::find()->where(['id' => $id, 'platform_id' => $platform_id])->one(); $coin = Coin::find()->where(['id' => $id, 'platform_id' => $platform_id])->one();
...@@ -282,7 +288,7 @@ class CoinController extends BaseController ...@@ -282,7 +288,7 @@ class CoinController extends BaseController
*/ */
public function actionGetExchangeListById() public function actionGetExchangeListById()
{ {
$id = Yii::$app->request->get('id', 0); $id = Yii::$app->request->get('id', 0);
$exchanges = []; $exchanges = [];
if ($id) { if ($id) {
$exchanges = CoinBusiness::getExchangeListById($id); $exchanges = CoinBusiness::getExchangeListById($id);
...@@ -302,11 +308,11 @@ class CoinController extends BaseController ...@@ -302,11 +308,11 @@ class CoinController extends BaseController
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
$get = Yii::$app->request->get(); $get = Yii::$app->request->get();
$page = $get['page'] ?? 1; $page = $get['page'] ?? 1;
$limit = $get['limit'] ?? 10; $limit = $get['limit'] ?? 10;
$name = $get['name'] ?? ''; $name = $get['name'] ?? '';
$platform = $get['platform'] ?? ''; $platform = $get['platform'] ?? '';
$chain = $get['chain'] ?? ''; $chain = $get['chain'] ?? '';
$condition = []; $condition = [];
...@@ -348,8 +354,8 @@ class CoinController extends BaseController ...@@ -348,8 +354,8 @@ class CoinController extends BaseController
$platforms = CoinPlatform::find()->where(['id' => $user_platform_id])->asArray()->all(); $platforms = CoinPlatform::find()->where(['id' => $user_platform_id])->asArray()->all();
} }
return $this->render('package', [ return $this->render('package', [
'platforms' => $platforms, 'platforms' => $platforms,
'chains' => $chains, 'chains' => $chains,
'coin_platforms' => $coin_platforms, 'coin_platforms' => $coin_platforms,
]); ]);
} }
...@@ -363,7 +369,7 @@ class CoinController extends BaseController ...@@ -363,7 +369,7 @@ class CoinController extends BaseController
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$id = Yii::$app->request->get('id', ''); $id = Yii::$app->request->get('id', '');
$platform_id = Yii::$app->request->get('platform_id', ''); $platform_id = Yii::$app->request->get('platform_id', '');
if (empty($platform_id)) { if (empty($platform_id)) {
return ['code' => -1, 'msg' => '请选择钱包']; return ['code' => -1, 'msg' => '请选择钱包'];
...@@ -385,8 +391,8 @@ class CoinController extends BaseController ...@@ -385,8 +391,8 @@ class CoinController extends BaseController
} }
if ($can) { if ($can) {
//删除 //删除
$platform_ids = array_diff($platform_ids, [$platform_id]); $platform_ids = array_diff($platform_ids, [$platform_id]);
$platform_ids = implode(',', $platform_ids); $platform_ids = implode(',', $platform_ids);
$coin->platform_id = $platform_ids; $coin->platform_id = $platform_ids;
if ($coin->save()) { if ($coin->save()) {
return ['code' => 0, 'msg' => '删除成功']; return ['code' => 0, 'msg' => '删除成功'];
...@@ -411,10 +417,10 @@ class CoinController extends BaseController ...@@ -411,10 +417,10 @@ class CoinController extends BaseController
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$get = Yii::$app->request->get(); $get = Yii::$app->request->get();
$platform_id = $get['platform_id'] ?? ''; $platform_id = $get['platform_id'] ?? '';
$name = $get['name'] ?? ''; $name = $get['name'] ?? '';
$chain = $get['chain'] ?? ''; $chain = $get['chain'] ?? '';
foreach (['platform_id' => '平台', 'name' => '币种名称', 'chain' => '币种主链'] as $key => $value) { foreach (['platform_id' => '平台', 'name' => '币种名称', 'chain' => '币种主链'] as $key => $value) {
if (empty($$key)) { if (empty($$key)) {
return ['code' => -1, 'msg' => $value . '不能为空']; return ['code' => -1, 'msg' => $value . '不能为空'];
...@@ -423,9 +429,9 @@ class CoinController extends BaseController ...@@ -423,9 +429,9 @@ class CoinController extends BaseController
$coin = Coin::find()->where(['name' => $name, 'chain' => $chain])->One(); $coin = Coin::find()->where(['name' => $name, 'chain' => $chain])->One();
if ($coin) { if ($coin) {
$can = false; $can = false;
$user_platform_id = Yii::$app->user->identity->platform_id; $user_platform_id = Yii::$app->user->identity->platform_id;
$platform_ids = explode(',', $coin->platform_id); $platform_ids = explode(',', $coin->platform_id);
if ($user_platform_id == Yii::$app->params['admin']) { if ($user_platform_id == Yii::$app->params['admin']) {
$can = true; $can = true;
...@@ -457,9 +463,9 @@ class CoinController extends BaseController ...@@ -457,9 +463,9 @@ class CoinController extends BaseController
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$get = Yii::$app->request->get(); $get = Yii::$app->request->get();
$platform_id = $get['platform_id'] ?? ''; $platform_id = $get['platform_id'] ?? '';
$coin_ids = $get['coin_ids'] ?? ''; $coin_ids = $get['coin_ids'] ?? '';
foreach (['platform_id' => '钱包', 'coin_ids' => '币种'] as $key => $value) { foreach (['platform_id' => '钱包', 'coin_ids' => '币种'] as $key => $value) {
if (empty($$key)) { if (empty($$key)) {
return ['code' => -1, 'msg' => $value . '不能为空']; return ['code' => -1, 'msg' => $value . '不能为空'];
...@@ -467,11 +473,11 @@ class CoinController extends BaseController ...@@ -467,11 +473,11 @@ class CoinController extends BaseController
} }
$user_platform_id = Yii::$app->user->identity->platform_id; $user_platform_id = Yii::$app->user->identity->platform_id;
if ($user_platform_id == Yii::$app->params['admin']) { if ($user_platform_id == Yii::$app->params['admin']) {
$coin_id_items = explode(',',$coin_ids); $coin_id_items = explode(',', $coin_ids);
foreach($coin_id_items as $id) { foreach ($coin_id_items as $id) {
$coin = Coin::getOneById($id); $coin = Coin::getOneById($id);
if($coin){ if ($coin) {
$platform_ids = explode(',',$coin->platform_id); $platform_ids = explode(',', $coin->platform_id);
$platform_ids = implode(',', array_unique(array_merge($platform_ids, [$platform_id]))); $platform_ids = implode(',', array_unique(array_merge($platform_ids, [$platform_id])));
$coin->platform_id = $platform_ids; $coin->platform_id = $platform_ids;
$coin->save(); $coin->save();
...@@ -491,9 +497,9 @@ class CoinController extends BaseController ...@@ -491,9 +497,9 @@ class CoinController extends BaseController
{ {
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$get = Yii::$app->request->get(); $get = Yii::$app->request->get();
$platform_id = $get['platform_id'] ?? ''; $platform_id = $get['platform_id'] ?? '';
$coin_ids = $get['coin_ids'] ?? ''; $coin_ids = $get['coin_ids'] ?? '';
foreach (['platform_id' => '钱包', 'coin_ids' => '币种'] as $key => $value) { foreach (['platform_id' => '钱包', 'coin_ids' => '币种'] as $key => $value) {
if (empty($$key)) { if (empty($$key)) {
return ['code' => -1, 'msg' => $value . '不能为空']; return ['code' => -1, 'msg' => $value . '不能为空'];
...@@ -501,11 +507,11 @@ class CoinController extends BaseController ...@@ -501,11 +507,11 @@ class CoinController extends BaseController
} }
$user_platform_id = Yii::$app->user->identity->platform_id; $user_platform_id = Yii::$app->user->identity->platform_id;
if ($user_platform_id == Yii::$app->params['admin']) { if ($user_platform_id == Yii::$app->params['admin']) {
$coin_id_items = explode(',',$coin_ids); $coin_id_items = explode(',', $coin_ids);
foreach($coin_id_items as $id) { foreach ($coin_id_items as $id) {
$coin = Coin::getOneById($id); $coin = Coin::getOneById($id);
if($coin){ if ($coin) {
$platform_ids = explode(',',$coin->platform_id); $platform_ids = explode(',', $coin->platform_id);
$platform_ids = implode(',', array_diff($platform_ids, [$platform_id])); $platform_ids = implode(',', array_diff($platform_ids, [$platform_id]));
$coin->platform_id = $platform_ids; $coin->platform_id = $platform_ids;
$coin->save(); $coin->save();
...@@ -527,11 +533,11 @@ class CoinController extends BaseController ...@@ -527,11 +533,11 @@ class CoinController extends BaseController
Yii::$app->response->format = 'json'; Yii::$app->response->format = 'json';
$request = Yii::$app->request; $request = Yii::$app->request;
$data = Coin::getPlatformList(); $data = Coin::getPlatformList();
foreach ($data as $item){ foreach ($data as $item) {
if($item){ if ($item) {
$platformInfo['platform'] = $item; $platformInfo['platform'] = $item;
$icon = Yii::$app->redis->hget('platform_image_info',$item); $icon = Yii::$app->redis->hget('platform_image_info', $item);
$brower_url = Yii::$app->redis->hget('platform_brower_info',$item); $brower_url = Yii::$app->redis->hget('platform_brower_info', $item);
$platformInfo['icon'] = $icon ?? ''; $platformInfo['icon'] = $icon ?? '';
$platformInfo['brower_url'] = $brower_url ?? ''; $platformInfo['brower_url'] = $brower_url ?? '';
$platformItems[] = $platformInfo; $platformItems[] = $platformInfo;
...@@ -548,12 +554,12 @@ class CoinController extends BaseController ...@@ -548,12 +554,12 @@ class CoinController extends BaseController
*/ */
public function actionAddPlatformCoin() public function actionAddPlatformCoin()
{ {
if(Yii::$app->request->isPost){ if (Yii::$app->request->isPost) {
Yii::$app->response->format = 'json'; Yii::$app->response->format = 'json';
$platform = Yii::$app->request->post('platform'); $platform = Yii::$app->request->post('platform');
$image = Yii::$app->request->post('image'); $image = Yii::$app->request->post('image');
if($platform && $image){ if ($platform && $image) {
Yii::$app->redis->hset('platform_image_info',$platform,$image); Yii::$app->redis->hset('platform_image_info', $platform, $image);
return ['code' => 0, 'msg' => '图片添加成功']; return ['code' => 0, 'msg' => '图片添加成功'];
} }
return ['code' => 0, 'msg' => '图片添加失败']; return ['code' => 0, 'msg' => '图片添加失败'];
...@@ -569,13 +575,13 @@ class CoinController extends BaseController ...@@ -569,13 +575,13 @@ class CoinController extends BaseController
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
Yii::$app->response->format = 'json'; Yii::$app->response->format = 'json';
$request = Yii::$app->request; $request = Yii::$app->request;
$platform = $request->get('platform',''); $platform = $request->get('platform', '');
$brower_url = $request->get('brower_url',''); $brower_url = $request->get('brower_url', '');
if($platform){ if ($platform) {
Yii::$app->redis->hset('platform_brower_info',$platform,$brower_url); Yii::$app->redis->hset('platform_brower_info', $platform, $brower_url);
return ['code' => 0,'msg' => '区块链浏览器地址设置成功']; return ['code' => 0, 'msg' => '区块链浏览器地址设置成功'];
}else{ } else {
return ['code' => 1 ,'msg' => '区块链浏览器地址设置失败']; return ['code' => 1, 'msg' => '区块链浏览器地址设置失败'];
} }
} }
} }
......
...@@ -14,6 +14,7 @@ class CoinForm extends Model ...@@ -14,6 +14,7 @@ class CoinForm extends Model
{ {
public $id; public $id;
public $name; public $name;
public $optional_name;
public $nickname; public $nickname;
public $sid; public $sid;
public $icon; public $icon;
...@@ -49,6 +50,7 @@ class CoinForm extends Model ...@@ -49,6 +50,7 @@ class CoinForm extends Model
return [ return [
'id' => 'ID', 'id' => 'ID',
'name' => '名称', 'name' => '名称',
'optional_name' => '可选简称',
'nickname' => '别称', 'nickname' => '别称',
'sid' => '全称', 'sid' => '全称',
'icon' => '图标', 'icon' => '图标',
...@@ -74,6 +76,7 @@ class CoinForm extends Model ...@@ -74,6 +76,7 @@ class CoinForm extends Model
'add' => [ 'add' => [
'id', 'id',
'name', 'name',
'optional_name',
'nickname', 'nickname',
'sid', 'sid',
'icon', 'icon',
...@@ -92,6 +95,7 @@ class CoinForm extends Model ...@@ -92,6 +95,7 @@ class CoinForm extends Model
'update' => [ 'update' => [
'id', 'id',
'name', 'name',
'optional_name',
'nickname', 'nickname',
'sid', 'sid',
'icon', 'icon',
......
...@@ -19,25 +19,33 @@ ...@@ -19,25 +19,33 @@
<input name="id" type="hidden" value="<?= $model->id ?>"> <input name="id" type="hidden" value="<?= $model->id ?>">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">简称</label> <label class="layui-form-label">简称</label>
<div class="layui-input-block"> <div class="layui-input-block" style="width: 250px">
<input class="layui-input" name="name" placeholder="请填写大写字母" value="<?= $model->name ?>" lay-verify="required"> <input class="layui-input" name="name" placeholder="请填写大写字母" value="<?= $model->name ?>"
lay-verify="required">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">可选简称</label>
<div class="layui-input-block"style="width: 250px">
<input class="layui-input" name="optional_name" placeholder="请填写大写字母"
value="<?= $model->optional_name ?>" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">中文名</label> <label class="layui-form-label">中文名</label>
<div class="layui-input-block" style="width: 250px"> <div class="layui-input-block" style="width: 190px">
<input class="layui-input" name="nickname[]" value="<?= $model->nickname['zh-CN'] ?>"> <input class="layui-input" name="nickname[]" value="<?= $model->nickname['zh-CN'] ?>">
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">英文名</label> <label class="layui-form-label">英文名</label>
<div class="layui-input-block" style="width: 250px"> <div class="layui-input-block" style="width: 190px">
<input class="layui-input" name="nickname[]" value="<?= $model->nickname['en-US'] ?>"> <input class="layui-input" name="nickname[]" value="<?= $model->nickname['en-US'] ?>">
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">日文名</label> <label class="layui-form-label">日文名</label>
<div class="layui-input-block" style="width: 250px"> <div class="layui-input-block" style="width: 190px">
<input class="layui-input" name="nickname[]" value="<?= $model->nickname['ja'] ?>"> <input class="layui-input" name="nickname[]" value="<?= $model->nickname['ja'] ?>">
</div> </div>
</div> </div>
......
...@@ -20,7 +20,15 @@ ...@@ -20,7 +20,15 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">简称</label> <label class="layui-form-label">简称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input" name="name" placeholder="请填写大写字母" value="<?= $model->name ?>" lay-verify="required"> <input class="layui-input" name="name" placeholder="请填写大写字母" value="<?= $model->name ?>"
lay-verify="required">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">可选简称</label>
<div class="layui-input-block">
<input class="layui-input" name="optional_name" placeholder="请填写大写字母" value="<?= $model->optional_name ?>"
lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
...@@ -76,7 +84,7 @@ ...@@ -76,7 +84,7 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" class="layui-input" name="address" value="<?= $model->address ?>"> <input type="text" class="layui-input" name="address" value="<?= $model->address ?>">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">精度</label> <label class="layui-form-label">精度</label>
<div class="layui-input-block"> <div class="layui-input-block">
...@@ -121,10 +129,12 @@ ...@@ -121,10 +129,12 @@
<select name="treaty"> <select name="treaty">
<option value="1" <?php if ($model->treaty == 1) { <option value="1" <?php if ($model->treaty == 1) {
echo "selected"; echo "selected";
} ?>>token</option> } ?>>token
</option>
<option value="2" <?php if ($model->treaty == 2) { <option value="2" <?php if ($model->treaty == 2) {
echo "selected"; echo "selected";
} ?>>coins</option> } ?>>coins
</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -253,7 +253,7 @@ class ExchangeBusiness ...@@ -253,7 +253,7 @@ class ExchangeBusiness
public static function getApiListForIndex($page = 1, $limit = 999, $condition = [], $fields = []) public static function getApiListForIndex($page = 1, $limit = 999, $condition = [], $fields = [])
{ {
if (!$fields) { if (!$fields) {
$fields = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain', 'address as contract_address', 'treaty']; $fields = ['id', 'sid', 'icon', 'name', 'optional_name', 'nickname', 'platform', 'chain', 'address as contract_address', 'treaty'];
} }
$rows = Coin::getSelectList($page, $limit, $fields, $condition); $rows = Coin::getSelectList($page, $limit, $fields, $condition);
$count = 0; $count = 0;
...@@ -307,7 +307,7 @@ class ExchangeBusiness ...@@ -307,7 +307,7 @@ class ExchangeBusiness
*/ */
public static function SearchByName($page = 1, $limit = 10, $condition = []) public static function SearchByName($page = 1, $limit = 10, $condition = [])
{ {
$rows = Coin::getSelectList($page, $limit, ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain', 'address as contract_address', 'treaty'], $rows = Coin::getSelectList($page, $limit, ['id', 'sid', 'icon', 'name', 'optional_name', 'nickname', 'platform', 'chain', 'address as contract_address', 'treaty'],
$condition); $condition);
if ($rows['count'] > 0) { if ($rows['count'] > 0) {
$total = $rows['count']; $total = $rows['count'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment