|
|
@@ -193,6 +193,19 @@ class User extends BaseController
|
|
193
|
193
|
}
|
|
194
|
194
|
|
|
195
|
195
|
}
|
|
|
196
|
+
|
|
|
197
|
+
|
|
|
198
|
+ public function vr_name()
|
|
|
199
|
+ {
|
|
|
200
|
+ $uid = $this->request->uid();
|
|
|
201
|
+ $data = [
|
|
|
202
|
+ "name"=>"VR转账",
|
|
|
203
|
+ "url"=>'https://show.gdjbp.com/?uid=' .$uid,
|
|
|
204
|
+ ];
|
|
|
205
|
+ return app('json')->success($data);
|
|
|
206
|
+ }
|
|
|
207
|
+
|
|
|
208
|
+
|
|
196
|
209
|
public function hongbao_list(){
|
|
197
|
210
|
$pm = $this->request->param('pm');
|
|
198
|
211
|
|
|
|
@@ -720,6 +733,14 @@ class User extends BaseController
|
|
720
|
733
|
$params['status'] = 1;
|
|
721
|
734
|
$res = $this->repository->add_cer($params, $member_id);
|
|
722
|
735
|
if ($res) {
|
|
|
736
|
+ //赠送积分 完善实名送20个积分,同时送邀请人20个积
|
|
|
737
|
+ $this->sign_add($member_id, 20,1,'完善实名系统赠送20个积分','','');
|
|
|
738
|
+ $member_info = Db::name('user')->where( array('uid' => $member_id) )->find();
|
|
|
739
|
+ if($member_info['spread_uid']){
|
|
|
740
|
+ //首次邀请好友奖励积分
|
|
|
741
|
+ $spreadUid = $member_info['spread_uid'];
|
|
|
742
|
+ $this->sign_add($spreadUid, 20,1,'好友完善实名系统赠送20个积分','','');
|
|
|
743
|
+ }
|
|
723
|
744
|
return app('json')->success($res);
|
|
724
|
745
|
} else {
|
|
725
|
746
|
return app('json')->fail('认证失败');
|
|
|
@@ -730,6 +751,48 @@ class User extends BaseController
|
|
730
|
751
|
|
|
731
|
752
|
}
|
|
732
|
753
|
|
|
|
754
|
+
|
|
|
755
|
+ /**
|
|
|
756
|
+ * @param int $uid 用户ID
|
|
|
757
|
+ * @param string $score 积分
|
|
|
758
|
+ * @param int $status 积分状态
|
|
|
759
|
+ * @param string $mark 备注
|
|
|
760
|
+ * @param string $has_qian 连续签到天数
|
|
|
761
|
+ * @param string $today_signintime 签到时间
|
|
|
762
|
+ * @param int $order_id 订单ID
|
|
|
763
|
+ * @param int $pm 1-收入。2-支出
|
|
|
764
|
+ * @param string $order_type
|
|
|
765
|
+ * @throws DbException
|
|
|
766
|
+ */
|
|
|
767
|
+ public function sign_add($uid, $score, $status, $mark, $has_qian = '', $today_signintime = '', $order_id = 0, $pm = 1, $order_type = '',$type='',$settlement_time = '')
|
|
|
768
|
+ {
|
|
|
769
|
+ if(!in_array($type,[1,2])){
|
|
|
770
|
+ // 其他情况都直接返回,因为目前只有365专区购买才可以获得
|
|
|
771
|
+ return false;
|
|
|
772
|
+ }
|
|
|
773
|
+
|
|
|
774
|
+ $ins_data['uid'] = $uid;
|
|
|
775
|
+ $ins_data['continuity_day'] = $has_qian;
|
|
|
776
|
+ $ins_data['reward_socre'] = $score;
|
|
|
777
|
+ $ins_data['signin_time'] = $today_signintime;
|
|
|
778
|
+ $ins_data['addtime'] = time();
|
|
|
779
|
+ $ins_data['status'] = $status;
|
|
|
780
|
+ $ins_data['mark'] = $mark;
|
|
|
781
|
+ $ins_data['type'] = $type;
|
|
|
782
|
+ $ins_data['settlement_time'] = $settlement_time;// 结算时间 真正到了结算时间会结算
|
|
|
783
|
+ $ins_data['order_id'] = $order_id;
|
|
|
784
|
+ $ins_data['pm'] = $pm;
|
|
|
785
|
+ $ins_data['order_type'] = $order_type;
|
|
|
786
|
+ Db::name('user_sign_score')->insertGetId($ins_data);
|
|
|
787
|
+
|
|
|
788
|
+ if($pm == 1 && $status == 1){
|
|
|
789
|
+ Db::name('user')->where('uid',$uid)->inc('score', $score)->update();
|
|
|
790
|
+ }
|
|
|
791
|
+ if($pm == 2){
|
|
|
792
|
+ Db::name('user')->where('uid', $uid)->dec('score', $score)->update();
|
|
|
793
|
+ }
|
|
|
794
|
+ }
|
|
|
795
|
+
|
|
733
|
796
|
/**
|
|
734
|
797
|
* 申请代理
|
|
735
|
798
|
* name:公司名称
|
|
|
@@ -3185,7 +3248,7 @@ class User extends BaseController
|
|
3185
|
3248
|
* 转VR
|
|
3186
|
3249
|
*/
|
|
3187
|
3250
|
public function transition_vr()
|
|
3188
|
|
- {
|
|
|
3251
|
+ {
|
|
3189
|
3252
|
$uid = $this->request->uid();
|
|
3190
|
3253
|
$user = $this->request->userInfo();
|
|
3191
|
3254
|
$type = $this->request->param('type', 'brokerage');
|
|
|
@@ -3193,11 +3256,11 @@ class User extends BaseController
|
|
3193
|
3256
|
if ($type == 'brokerage') {
|
|
3194
|
3257
|
$brokerage_price = Db::name('user')->where('uid', $uid)->value('brokerage_price');
|
|
3195
|
3258
|
$no_clear_amount = Db::name('user_bill')
|
|
3196
|
|
- ->where('uid', $uid)
|
|
3197
|
|
- ->where('commission_type', '<>', 5)
|
|
3198
|
|
- ->where('pm', 1)
|
|
3199
|
|
- ->where('status', 0)
|
|
3200
|
|
- ->sum('number');
|
|
|
3259
|
+ ->where('uid', $uid)
|
|
|
3260
|
+ ->where('commission_type', '<>', 5)
|
|
|
3261
|
+ ->where('pm', 1)
|
|
|
3262
|
+ ->where('status', 0)
|
|
|
3263
|
+ ->sum('number');
|
|
3201
|
3264
|
$clear_amount = $brokerage_price - $no_clear_amount;
|
|
3202
|
3265
|
if ($user['brokerage_price'] < (systemConfig('withdrawal_money'))){
|
|
3203
|
3266
|
return app('json')->fail('未到达提现最低额度');
|
|
|
@@ -3237,20 +3300,20 @@ class User extends BaseController
|
|
3237
|
3300
|
* 转VR记录
|
|
3238
|
3301
|
*/
|
|
3239
|
3302
|
public function transition_vr_log()
|
|
3240
|
|
- {
|
|
|
3303
|
+ {
|
|
3241
|
3304
|
$uid = $this->request->uid();
|
|
3242
|
3305
|
$type = $this->request->param('type', 1);
|
|
3243
|
|
- [$page, $limit] = $this->getPage();
|
|
3244
|
|
- $where = [];
|
|
3245
|
|
- $where[] = ['uid', '=', $uid];
|
|
|
3306
|
+ [$page, $limit] = $this->getPage();
|
|
|
3307
|
+ $where = [];
|
|
|
3308
|
+ $where[] = ['uid', '=', $uid];
|
|
3246
|
3309
|
$where[] = ['type', '=', $type];
|
|
3247
|
|
- $query = Db::name("user_transition_vr");
|
|
|
3310
|
+ $query = Db::name("user_transition_vr");
|
|
3248
|
3311
|
$count = $query->where($where)->count();
|
|
3249
|
3312
|
$list = $query->page($page, $limit)->where($where)->select()->each(function ($item){
|
|
3250
|
|
- $item['create_time'] = date("Y-m-d H:i:s", $item['create_time']);
|
|
|
3313
|
+ $item['create_time'] = date("Y-m-d H:i:s", $item['create_time']);
|
|
3251
|
3314
|
return $item;
|
|
3252
|
3315
|
});
|
|
3253
|
|
- return app('json')->success('获取转VR记录成功', ['list'=>$list, 'count'=>$count]);
|
|
|
3316
|
+ return app('json')->success('获取转VR记录成功', ['list'=>$list, 'count'=>$count]);
|
|
3254
|
3317
|
}
|
|
3255
|
3318
|
|
|
3256
|
3319
|
|