|
@@ -5,6 +5,7 @@ namespace app\index\controller;
|
|
|
use app\common\enum\order\PayStatus;
|
|
|
use app\index\model\Goods;
|
|
|
use app\index\model\ShareKey;
|
|
|
+use app\index\model\user\UserAccessLog;
|
|
|
use app\index\service\passport\MailCaptcha as MailCaptchaService;
|
|
|
use app\index\model\OrderAddress;
|
|
|
use app\index\model\user\PointsLog as PointsLogModel;
|
|
@@ -197,19 +198,19 @@ class User extends Controller
|
|
|
$smtp = new UMailer(config('smtp.host'), config('smtp.port'), true,
|
|
|
config('smtp.username'), config('smtp.password'));
|
|
|
$smtp->debug = true; //是否显示发送的调试信息
|
|
|
- $flag = $smtp->sendShareText($mailbox, config('smtp.username'),'Code','HTML','','','', $url);
|
|
|
+ $flag = $smtp->sendShareText($mailbox, config('smtp.username'), 'Code', 'HTML', '', '', '', $url);
|
|
|
if ($flag) {
|
|
|
$shareKeyModel = new ShareKey();
|
|
|
$shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'store_id' => $this->storeId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
|
|
|
return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.');
|
|
|
}
|
|
|
|
|
|
-/* $MailCaptchaService = new MailCaptchaService;
|
|
|
- if ($MailCaptchaService->sendText($mailbox, 'From Your Friend', $url)) {
|
|
|
- $shareKeyModel = new ShareKey();
|
|
|
- $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'store_id' => $this->storeId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
|
|
|
- return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.');
|
|
|
- }*/
|
|
|
+ /* $MailCaptchaService = new MailCaptchaService;
|
|
|
+ if ($MailCaptchaService->sendText($mailbox, 'From Your Friend', $url)) {
|
|
|
+ $shareKeyModel = new ShareKey();
|
|
|
+ $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'store_id' => $this->storeId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
|
|
|
+ return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.');
|
|
|
+ }*/
|
|
|
|
|
|
if (is_debug()) {
|
|
|
$shareKeyModel = new ShareKey();
|
|
@@ -898,4 +899,34 @@ class User extends Controller
|
|
|
dd($f);
|
|
|
}
|
|
|
|
|
|
+ public function pullAccessLogs()
|
|
|
+ {
|
|
|
+ $path = $this->request->param('path','');
|
|
|
+
|
|
|
+ $from = $this->request->param('from');
|
|
|
+ $to = $this->request->param('to');
|
|
|
+
|
|
|
+ $page = $this->request->param('page', 1);
|
|
|
+ $size = $this->request->param('size', 50);
|
|
|
+
|
|
|
+ $fromInt = strtotime($from);
|
|
|
+ if (!$fromInt) {
|
|
|
+ return $this->renderError('input valid from time');
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($to) && !strtotime($to)) {
|
|
|
+ return $this->renderError('input valid to time');
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($to)) {
|
|
|
+ $toInt = strtotime($to);
|
|
|
+ } else {
|
|
|
+ $toInt = time();
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = UserAccessLog::getAccessLog($path, $fromInt, $toInt, $page, $size);
|
|
|
+
|
|
|
+ return $this->renderSuccess($data);
|
|
|
+ }
|
|
|
+
|
|
|
}
|