Commit b1cc584e authored by shajiaiming's avatar shajiaiming

fix

parent 79b84251
......@@ -15,7 +15,7 @@ class IssueCoinController extends BaseController
$platform_id = Yii::$app->request->getPlatformId();
$page = \Yii::$app->request->get('page', 1);
$size = \Yii::$app->request->get('size', 10);
$status = \Yii::$app->request->get('status', '');
$status = \Yii::$app->request->get('status', -1);
$owner = \Yii::$app->request->get('owner', '');
$chain_id = \Yii::$app->request->get('chain_id', '');
if (1 == $platform_id) {
......@@ -28,17 +28,16 @@ class IssueCoinController extends BaseController
->where(['platform_id' => $platform_id])
->orderBy('create_time desc');
}
if (false != $status) {
$query->where(['status' => $status]);
if ( $status > -1) {
$query->andWhere(['status' => $status]);
}
if (false != $owner) {
$query->where(['owner' => $owner]);
$query->andWhere(['owner' => $owner]);
}
if(false != $chain_id) {
$query->where(['chain_id' => $chain_id]);
$query->andWhere(['chain_id' => $chain_id]);
}
$countQuery = clone $query;
......@@ -46,6 +45,7 @@ class IssueCoinController extends BaseController
$models = $query->offset($pages->offset)
->limit($pages->limit)
->all();
foreach ($models as &$val) {
$val->chain_id = $val->chain->chain_name;
}
......
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