Commit d7906fe2 authored by shajiaiming's avatar shajiaiming

fix

parent cabf5378
......@@ -107,6 +107,8 @@ class PlatformCoinsController extends BaseController
$header = Yii::$app->request->headers;
$deviceCode = $header['FZM-REQUEST-UUID'] ?? null;
$version = $header['version'] ?? null;
$device = $header['device'] ?? null;
if (empty($platform_id) || empty($coins_address) || empty($type)) {
return ['code' => -1, 'data' => null, 'msg' => '缺少必要的参数'];
......@@ -146,6 +148,8 @@ class PlatformCoinsController extends BaseController
$type,
$deviceCode,
$platform_id,
$device,
$version
];
}
if (empty($item_array)) {
......
......@@ -22,17 +22,19 @@ class CoinPlatformCoins extends BaseActiveRecord
return '{{%coin_platform_coins}}';
}
public function rules() {
public function rules()
{
return [
[['coins_name','coins_address', 'type', 'deviceCode', 'platform_id'], 'required'],
[['coins_name', 'coins_address', 'type', 'deviceCode', 'platform_id'], 'required'],
];
}
public function scenarios() {
public function scenarios()
{
$scenarios = [
self:: SCENARIOS_CREATE => ['coins_name','coins_address', 'type', 'deviceCode', 'platform_id'],
self:: SCENARIOS_CREATE => ['coins_name', 'coins_address', 'type', 'deviceCode', 'platform_id'],
];
return array_merge( parent:: scenarios(), $scenarios);
return array_merge(parent:: scenarios(), $scenarios);
}
/**
......@@ -47,7 +49,7 @@ class CoinPlatformCoins extends BaseActiveRecord
return false;
}
try {
$result = self::getDb()->createCommand()->batchInsert(self::tableName(), ['coins_name', 'coins_address', 'type', 'deviceCode', 'platform_id'], $datas)->execute();
$result = self::getDb()->createCommand()->batchInsert(self::tableName(), ['coins_name', 'coins_address', 'type', 'deviceCode', 'platform_id', 'device', 'version'], $datas)->execute();
return $result;
} catch (\Exception $e) {
}
......
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