Commit 4316ab75 authored by ZhuChunYang's avatar ZhuChunYang

update

parent 2eecdfc7
......@@ -12,6 +12,7 @@ use backend\models\coin\CoinForm;
use common\business\CoinBusiness;
use common\models\psources\Coin;
use common\models\psources\CoinPlatform;
use common\models\psources\CoinRecommend;
use Yii;
use yii\validators\ImageValidator;
use yii\web\Response;
......@@ -189,6 +190,11 @@ class CoinController extends BaseController
Yii::$app->response->format = 'json';
$id = Yii::$app->request->get('id', 0);
if ($id) {
$coin_recommend = CoinRecommend::find()->where(['cid' => $id])->one();
if($coin_recommend){
return ['code' => -1, 'msg' => '推荐币种里有改币种,无法删除'];
}
$model = Coin::findOne(['id' => $id]);
if ($model) {
$platform_id = Yii::$app->user->identity->platform_id;
......
......@@ -15,6 +15,7 @@ class CoinForm extends Model
public $id;
public $name;
public $nickname;
public $sid;
public $icon;
public $introduce;
public $official;
......@@ -48,6 +49,7 @@ class CoinForm extends Model
'id' => 'ID',
'name' => '名称',
'nickname' => '别称',
'sid' => '全称',
'icon' => '图标',
'introduce' => '介绍',
'official' => '官网',
......@@ -71,6 +73,7 @@ class CoinForm extends Model
'id',
'name',
'nickname',
'sid',
'icon',
'introduce',
'official',
......@@ -88,6 +91,7 @@ class CoinForm extends Model
'id',
'name',
'nickname',
'sid',
'icon',
'introduce',
'official',
......
......@@ -30,6 +30,12 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">币种全称</label>
<div class="layui-input-block">
<input class="layui-input" name="sid" value="<?= $model->sid ?>">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">官网</label>
<div class="layui-input-block">
<input class="layui-input" name="official" value="<?= $model->official ?>">
......
......@@ -30,6 +30,12 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">币种全称</label>
<div class="layui-input-block">
<input class="layui-input" name="sid" value="<?= $model->sid ?>">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">官网</label>
<div class="layui-input-block">
<input class="layui-input" name="official" value="<?= $model->official ?>">
......
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