|
@@ -111,14 +111,12 @@ class Pay extends Api
|
|
|
|
|
|
//金币充值
|
|
|
public function gold_config(){
|
|
|
- $list = Db::name('paygold_config')->where('is_show',1)->order('weight asc,id asc')->select();
|
|
|
- $data['goldconfig'] = $list;
|
|
|
|
|
|
- $user_wallet = model('wallet')->getWallet($this->auth->id);
|
|
|
- $data['gold'] = $user_wallet['gold'];
|
|
|
+ $data['gold'] = model('wallet')->getWallet($this->auth->id,'gold');
|
|
|
$data['rmb_to_gold'] = config('site.rmb_to_gold');
|
|
|
$data['is_first'] = Db::name('user_paygold_log')->where(['uid' => $this->auth->id])->count('id');
|
|
|
|
|
|
+ $list = Db::name('paygold_config')->where('is_show',1)->order('weight asc,id asc')->select();
|
|
|
if ($list) {
|
|
|
$arr = [
|
|
|
'id' => -1,
|
|
@@ -133,11 +131,13 @@ class Pay extends Api
|
|
|
'is_default' => 0,
|
|
|
];
|
|
|
|
|
|
- array_push($data['goldconfig'], $arr);
|
|
|
- foreach ($data['goldconfig'] as &$v) {
|
|
|
+ array_push($list, $arr);
|
|
|
+ foreach ($list as &$v) {
|
|
|
$v['is_first'] = $data['is_first'];
|
|
|
}
|
|
|
}
|
|
|
+ $data['goldconfig'] = $list;
|
|
|
+
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|