|
@@ -14,6 +14,9 @@
|
|
|
namespace app\controller\admin\user;
|
|
namespace app\controller\admin\user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+use app\common\model\store\order\StoreOrderProduct;
|
|
|
|
|
+use app\common\model\user\UserMerchant;
|
|
|
|
|
+use app\common\model\user\UserVisit;
|
|
|
use app\common\repositories\store\ExcelRepository;
|
|
use app\common\repositories\store\ExcelRepository;
|
|
|
use app\common\repositories\system\config\ConfigRepository;
|
|
use app\common\repositories\system\config\ConfigRepository;
|
|
|
use app\common\repositories\system\config\ConfigValueRepository;
|
|
use app\common\repositories\system\config\ConfigValueRepository;
|
|
@@ -22,6 +25,11 @@ use app\common\repositories\user\UserHistoryRepository;
|
|
|
use app\common\repositories\user\UserSignRepository;
|
|
use app\common\repositories\user\UserSignRepository;
|
|
|
use app\common\repositories\user\UserSpreadLogRepository;
|
|
use app\common\repositories\user\UserSpreadLogRepository;
|
|
|
use app\common\repositories\user\UserVisitRepository;
|
|
use app\common\repositories\user\UserVisitRepository;
|
|
|
|
|
+use app\controller\admin\store\StoreProductReply;
|
|
|
|
|
+use app\controller\admin\system\merchant\FinancialRecord;
|
|
|
|
|
+use app\controller\api\store\order\StoreCart;
|
|
|
|
|
+use app\controller\api\store\order\StoreOrder;
|
|
|
|
|
+use app\controller\api\user\UserHistory;
|
|
|
use app\validate\admin\UserAwardIntegralValidate;
|
|
use app\validate\admin\UserAwardIntegralValidate;
|
|
|
use app\validate\admin\UserAwardRangeValidate;
|
|
use app\validate\admin\UserAwardRangeValidate;
|
|
|
use app\validate\admin\UserRegisterValidate;
|
|
use app\validate\admin\UserRegisterValidate;
|
|
@@ -1051,5 +1059,67 @@ class User extends BaseController
|
|
|
$data = $storeCouponRepository->getList(0,['coupon_ids' => systemConfig('register_give_coupon')],$page, $limit);
|
|
$data = $storeCouponRepository->getList(0,['coupon_ids' => systemConfig('register_give_coupon')],$page, $limit);
|
|
|
return app('json')->success($data);
|
|
return app('json')->success($data);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+// 同步新老用户数据
|
|
|
|
|
+ public function synchUser()
|
|
|
|
|
+ {
|
|
|
|
|
+ $user_list = User::where('uid','>',82)->where('status',1)->select();
|
|
|
|
|
+ foreach ($user_list as $user){
|
|
|
|
|
+ $this->changeUser($user['uid']); //新账号uid
|
|
|
|
|
+ }
|
|
|
|
|
+ return app('json')->success('同步成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ public function changeUser($uid){
|
|
|
|
|
+ $user_data = User::where('uid',$uid)->where('status',1)->find();
|
|
|
|
|
+ if (!empty($user_data)){
|
|
|
|
|
+ $moto_user = User::where('nickname',$user_data['nickname'])->where('status',1)->find();
|
|
|
|
|
+ if (!empty($moto_user)){
|
|
|
|
|
+
|
|
|
|
|
+ User::where('uid',$uid)->update([
|
|
|
|
|
+ 'now_money'=>$moto_user['now_money'],
|
|
|
|
|
+ 'brokerage_price'=>$moto_user['brokerage_price'],
|
|
|
|
|
+ 'status'=>$moto_user['status'],
|
|
|
|
|
+ 'spread_uid'=>$moto_user['spread_uid'],
|
|
|
|
|
+ 'spread_time'=>$moto_user['spread_time'],
|
|
|
|
|
+ 'brokerage_level'=>$moto_user['brokerage_level'],
|
|
|
|
|
+ 'is_promoter'=>$moto_user['is_promoter'],
|
|
|
|
|
+ 'pay_count'=>$moto_user['pay_count'],
|
|
|
|
|
+ 'pay_price'=>$moto_user['pay_price'],
|
|
|
|
|
+ 'spread_count'=>$moto_user['spread_count'],
|
|
|
|
|
+ 'spread_pay_count'=>$moto_user['spread_pay_count'],
|
|
|
|
|
+ 'spread_pay_price'=>$moto_user['spread_pay_price'],
|
|
|
|
|
+ 'integral'=>$moto_user['integral'],
|
|
|
|
|
+ 'is_svip'=>$moto_user['is_svip'],
|
|
|
|
|
+ 'promoter_switch'=>$moto_user['promoter_switch'],
|
|
|
|
|
+ 'award_integral'=>$moto_user['award_integral'],
|
|
|
|
|
+ 'award_range'=>$moto_user['award_range'],
|
|
|
|
|
+ 'pack_count'=>$moto_user['pack_count'],
|
|
|
|
|
+ 'pack_count_all'=>$moto_user['pack_count_all'],
|
|
|
|
|
+ 'unclaimed_range'=>$moto_user['unclaimed_range'],
|
|
|
|
|
+ 'freeze_brokerage'=>$moto_user['freeze_brokerage'],
|
|
|
|
|
+ ]); //修改新用户数据
|
|
|
|
|
+ User::where('uid',$moto_user['uid'])->update(['status'=>0,'award_integral'=>0]); //修改老用户状态为冻结
|
|
|
|
|
+ UserMerchant::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //商户用户表
|
|
|
|
|
+ UserVisit::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //商品浏览分析表
|
|
|
|
|
+// user_recharge
|
|
|
|
|
+ UserRecharge::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //用户充值表
|
|
|
|
|
+// user_history
|
|
|
|
|
+ UserHistory::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //用户浏览历史表
|
|
|
|
|
+// user_extract
|
|
|
|
|
+ UserExtract::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //用户提现表
|
|
|
|
|
+// user_bill
|
|
|
|
|
+ UserBill::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //用户账单表
|
|
|
|
|
+// store_product_reply
|
|
|
|
|
+ StoreProductReply::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //商品评论表
|
|
|
|
|
+// store_order_product
|
|
|
|
|
+ StoreOrderProduct::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //订单商品表
|
|
|
|
|
+// financial_record
|
|
|
|
|
+ FinancialRecord::where('user_id',$moto_user['uid'])->update(['user_id'=>$uid]); //商户财务流水
|
|
|
|
|
+// store_cart
|
|
|
|
|
+ StoreCart::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //购物车表
|
|
|
|
|
+// store_order
|
|
|
|
|
+ StoreOrder::where('uid',$moto_user['uid'])->update(['uid'=>$uid]); //订单表
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|