Просмотр исходного кода

APP小程序-注册登录-(beta)用户同意用户协议记录

xupuyuan месяцев назад: 11
Родитель
Сommit
02aad829d3
2 измененных файлов с 22 добавлено и 3 удалено
  1. 20 1
      app/common/repositories/user/UserRepository.php
  2. 2 2
      app/controller/api/Auth.php

+ 20 - 1
app/common/repositories/user/UserRepository.php

@@ -4480,10 +4480,29 @@ class UserRepository extends BaseRepository
4480 4480
         Db::name('operating_record')->insert([
4481 4481
             'uid' => $uid,
4482 4482
             'operation_model' => '1',
4483
-            'operate_model_type' => '1',
4483
+            'operation_type' => '1',
4484 4484
             'mark' => '用户同意用户协议记录',
4485 4485
             'operation_time' => date('Y-m-d H:i:s')
4486 4486
         ]);
4487 4487
     }
4488 4488
 
4489
+    /**
4490
+     * 添加用户操作记录
4491
+     * @param $uid
4492
+     * @param $model
4493
+     * @param $type
4494
+     * @param $mark
4495
+     * @return void
4496
+     */
4497
+    public function createUserOperatingRecord($uid, $model, $type, $mark)
4498
+    {
4499
+        Db::name('user_operating_record')->insert([
4500
+            'uid' => $uid,
4501
+            'operation_model' => $model,
4502
+            'operation_type' => $type,
4503
+            'mark' => $mark,
4504
+            'operation_time' => date('Y-m-d H:i:s')
4505
+        ]);
4506
+    }
4507
+
4489 4508
 }

+ 2 - 2
app/controller/api/Auth.php

@@ -558,7 +558,7 @@ class Auth extends BaseController
558 558
 
559 559
         $result = $repository->returnToken($user, $tokenInfo);
560 560
         $result['uid'] = $user->uid;
561
-        $repository->userar($user->uid);
561
+        $repository->createUserOperatingRecord($user->uid, 1, 1, '用户同意用户协议记录');
562 562
         return app('json')->success($result);
563 563
 
564 564
     }
@@ -1621,7 +1621,7 @@ class Auth extends BaseController
1621 1621
         // $repository->bindSpread($user, intval($data['spread']));
1622 1622
         $tokenInfo = $repository->createToken($user);
1623 1623
         $repository->loginAfter($user);
1624
-        $repository->userar($user->uid);
1624
+        $repository->createUserOperatingRecord($user->uid, 1, 1, '用户同意用户协议记录');
1625 1625
         return app('json')->success($repository->returnToken($user, $tokenInfo));
1626 1626
     }
1627 1627