Commit 07d48b97 authored by shajiaiming's avatar shajiaiming

ru

parent b39cf3ca
......@@ -4,7 +4,7 @@ namespace api\controllers;
use common\components\ErrorMessage;
use common\models\psources\CoinIssueRevokeRecord;
use common\models\psources\CoinIssueTemplate;
use common\models\psources\CoinIssueAttachment;
use common\service\chain33\Chain33Service;
use Yii;
use yii\data\Pagination;
......@@ -155,10 +155,11 @@ class IssueCoinController extends BaseController
$msg = 'ok';
$code = 0;
$data = $model->getPrimaryKey();
if (35 == $platform_id) {
$template = new CoinIssueTemplate();
if (0 != $params['token_type']) {
$template = new CoinIssueAttachment();
$template->issue_coin_id = $data;
$template->template = isset($result['template']) ? $result['template'] : [];
$template->origin = isset($result['origin']) ? $result['origin'] : '';
$template->template = isset($result['template']) ? $result['template'] : '{}';
$template->save();
}
......
......@@ -5,7 +5,7 @@ namespace common\models\psources;
use Yii;
use yii\db\Expression;
class CoinIssueTemplate extends CommonActiveRecord
class CoinIssueAttachment extends CommonActiveRecord
{
public static function getDb()
......@@ -15,7 +15,7 @@ class CoinIssueTemplate extends CommonActiveRecord
public static function tableName()
{
return '{{%coin_issue_template}}';
return '{{%coin_issue_attachment}}';
}
public function getTransfer()
......
......@@ -53,7 +53,7 @@ class CoinIssueCoin extends CommonActiveRecord
['symbol', 'string', 'length' => [6, 128]],
['name', 'string', 'length' => [3, 50]],
['nickname', 'string', 'length' => [0, 10]],
[['token_type', 'nickname'], 'safe'],
[['token_type', 'nickname', 'origin'], 'safe'],
['template', 'verfiyTemplate'],
#['status', 'in', 'range' => [1, 2, 0]],
['name', 'verfiyName'],
......@@ -66,7 +66,7 @@ class CoinIssueCoin extends CommonActiveRecord
{
$scenarios = [
self:: SCENARIOS_CREATE => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge', 'token_type', 'nickname'],
self:: SCENARIOS_CREATE_MALL => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'token_type', 'nickname', 'template'],
self:: SCENARIOS_CREATE_MALL => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'token_type', 'nickname', 'template', 'origin'],
self:: SCENARIOS_UPDATE => ['status'],
self:: SCENARIOS_CANCEL => ['status'],
];
......@@ -207,6 +207,6 @@ class CoinIssueCoin extends CommonActiveRecord
public function getTemplated()
{
return $this->hasOne(CoinIssueTemplate::className(), ['issue_coin_id' => 'id'])->select('template');
return $this->hasOne(CoinIssueAttachment::className(), ['issue_coin_id' => 'id'])->select('template');
}
}
\ No newline at end of file
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