|
|
@@ -720,6 +720,14 @@ class User extends BaseController
|
|
720
|
720
|
$params['status'] = 1;
|
|
721
|
721
|
$res = $this->repository->add_cer($params, $member_id);
|
|
722
|
722
|
if ($res) {
|
|
|
723
|
+ //赠送积分 完善实名送20个积分,同时送邀请人20个积
|
|
|
724
|
+ $this->sign_add($member_id, 20,1,'完善实名系统赠送20个积分','','');
|
|
|
725
|
+ $member_info = Db::name('user')->where( array('uid' => $member_id) )->find();
|
|
|
726
|
+ if($member_info['spread_uid']){
|
|
|
727
|
+ //首次邀请好友奖励积分
|
|
|
728
|
+ $spreadUid = $member_info['spread_uid'];
|
|
|
729
|
+ $this->sign_add($spreadUid, 20,1,'好友完善实名系统赠送20个积分','','');
|
|
|
730
|
+ }
|
|
723
|
731
|
return app('json')->success($res);
|
|
724
|
732
|
} else {
|
|
725
|
733
|
return app('json')->fail('认证失败');
|
|
|
@@ -730,6 +738,48 @@ class User extends BaseController
|
|
730
|
738
|
|
|
731
|
739
|
}
|
|
732
|
740
|
|
|
|
741
|
+
|
|
|
742
|
+ /**
|
|
|
743
|
+ * @param int $uid 用户ID
|
|
|
744
|
+ * @param string $score 积分
|
|
|
745
|
+ * @param int $status 积分状态
|
|
|
746
|
+ * @param string $mark 备注
|
|
|
747
|
+ * @param string $has_qian 连续签到天数
|
|
|
748
|
+ * @param string $today_signintime 签到时间
|
|
|
749
|
+ * @param int $order_id 订单ID
|
|
|
750
|
+ * @param int $pm 1-收入。2-支出
|
|
|
751
|
+ * @param string $order_type
|
|
|
752
|
+ * @throws DbException
|
|
|
753
|
+ */
|
|
|
754
|
+ public function sign_add($uid, $score, $status, $mark, $has_qian = '', $today_signintime = '', $order_id = 0, $pm = 1, $order_type = '',$type='',$settlement_time = '')
|
|
|
755
|
+ {
|
|
|
756
|
+ if(!in_array($type,[1,2])){
|
|
|
757
|
+ // 其他情况都直接返回,因为目前只有365专区购买才可以获得
|
|
|
758
|
+ return false;
|
|
|
759
|
+ }
|
|
|
760
|
+
|
|
|
761
|
+ $ins_data['uid'] = $uid;
|
|
|
762
|
+ $ins_data['continuity_day'] = $has_qian;
|
|
|
763
|
+ $ins_data['reward_socre'] = $score;
|
|
|
764
|
+ $ins_data['signin_time'] = $today_signintime;
|
|
|
765
|
+ $ins_data['addtime'] = time();
|
|
|
766
|
+ $ins_data['status'] = $status;
|
|
|
767
|
+ $ins_data['mark'] = $mark;
|
|
|
768
|
+ $ins_data['type'] = $type;
|
|
|
769
|
+ $ins_data['settlement_time'] = $settlement_time;// 结算时间 真正到了结算时间会结算
|
|
|
770
|
+ $ins_data['order_id'] = $order_id;
|
|
|
771
|
+ $ins_data['pm'] = $pm;
|
|
|
772
|
+ $ins_data['order_type'] = $order_type;
|
|
|
773
|
+ Db::name('user_sign_score')->insertGetId($ins_data);
|
|
|
774
|
+
|
|
|
775
|
+ if($pm == 1 && $status == 1){
|
|
|
776
|
+ Db::name('user')->where('uid',$uid)->inc('score', $score)->update();
|
|
|
777
|
+ }
|
|
|
778
|
+ if($pm == 2){
|
|
|
779
|
+ Db::name('user')->where('uid', $uid)->dec('score', $score)->update();
|
|
|
780
|
+ }
|
|
|
781
|
+ }
|
|
|
782
|
+
|
|
733
|
783
|
/**
|
|
734
|
784
|
* 申请代理
|
|
735
|
785
|
* name:公司名称
|