[]]); } /** * 我的订单页面 * @return \think\response\View */ public function order(string $orderType = 'received') { $userId = Session::get('user_id'); if (empty($userId)) { return view('passport/logIn'); } return view('order'); } /** * 订单详情 * @param $orderId * @return \think\response\View * @throws \cores\exception\BaseException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function orderDetails($orderId) { $userId = Session::get('user_id'); if (empty($userId)) { return view('passport/logIn'); } $orderId = intval($orderId); $model = OrderModel::getUserOrderDetail($orderId); $orderAddress = OrderAddress::get(['order_id' => $orderId]); if (!empty($model['express_no'])) { $expModel = new ExpressModel(); $tracks = $expModel->dynamicUsps($model['express_no']); //dd($tracks); } else { $tracks = []; } if (!$tracks) { $f1Track = []; } else { $f1Track = $tracks['list'][0]['trackList'] ?? []; } $createTimeInt = strtotime($model['create_time']); $selfTrack = []; if (time() > $createTimeInt + 9864) { $selfTrack[] = ['time' => date('Y-m-d H:i:s', $createTimeInt + 9864), 'text' => 'Orders taken', 'desc' => 'The order has entered the warehouse']; } if (time() > $createTimeInt + 3653) { $selfTrack[] = ['time' => date('Y-m-d H:i:s', $createTimeInt + 3653), 'text' => 'Orders taken', 'desc' => 'The merchant has received your order and is waiting to be shipped']; } $selfTrack[] = ['time' => date('Y-m-d H:i:s', $createTimeInt + 5), 'text' => 'Order paid', 'desc' => 'Successful']; return view('orderDetails', ['order' => $model, 'orderAddress' => $orderAddress, 'selfTrack' => $selfTrack, 'f1Track' => $f1Track]); } /** * 我的积分页面 * @return \think\response\View */ public function myScores() { $userId = Session::get('user_id'); if (empty($userId)) { return view('passport/logIn'); } $model = new PointsLogModel; $list = $model->getList(); $user = \app\index\service\User::getCurrentLoginUser(); return view('integral', ['user' => $user]); } /** * 我的积分列表 * @return \think\response\Json * @throws \app\common\exception\BaseException * @throws \think\db\exception\DbException */ public function pointsLogs() { $model = new PointsLogModel; $list = $model->getList(); return $this->renderSuccess(compact('list')); } /** * 分享商品 * @return \think\response\Json */ public function shareUser() { $userId = Session::get('user_id'); if (empty($userId)) { return $this->renderJson(config('status.not_logged'), 'Log in please!'); } $goodsId = $this->request->param('goodsId'); if (empty($goodsId)) { return $this->renderError('Invalid goods'); } $mailbox = $this->request->param('mailbox'); if (empty($mailbox)) { return $this->renderError('Invalid mailbox'); } $encryptUserId = encrypt(strval($userId)); $url = 'Your friend shared a product with you. Click on the link to view it now:' . config('app.app_host') . '/index/index/productDetails.html?goodsId=' . $goodsId . '&key=' . $encryptUserId; Log::info($url); $MailCaptchaService = new MailCaptchaService; if ($MailCaptchaService->sendText($mailbox, 'From Your Friend', $url)) { $shareKeyModel = new ShareKey(); $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]); return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.'); } return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.'); } public function genFakeUsers() { $names = ['Eliana', 'Elias', 'Brooklyn', 'Joshua', 'Elena', 'Nathan', 'Aubrey', 'Caleb', 'Claire', 'Ryan', 'Ivy', 'Adrian', 'Kinsley', 'Miles', 'Audrey', 'Eli', 'Maya', 'Nolan', 'Genesis', 'Christian', 'Skylar', 'Aaron', 'Bella', 'Cameron', 'Aaliyah', 'Ezekiel', 'Madelyn', 'Colton', 'Savannah', 'Luca', 'Anna', 'Landon', 'Delilah', 'Hunter', 'Serenity', 'Jonathan', 'Caroline', 'Santiago', 'Kennedy', 'Axel', 'Valentina', 'Easton', 'Ruby', 'Cooper', 'Sophie', 'Jeremiah', 'Alice', 'Angel', 'Gabriella', 'Roman', 'Sadie', 'Connor', 'Ariana', 'Jameson', 'Allison', 'Robert', 'Hailey', 'Greyson', 'Autumn', 'Jordan', 'Nevaeh', 'Ian', 'Natalia', 'Carson', 'Quinn', 'Jaxson', 'Josephine', 'Leonardo', 'Sarah', 'Nicholas', 'Cora', 'Dominic', 'Emery', 'Austin', 'Samantha', 'Everett', 'Piper', 'Brooks', 'Leilani', 'Xavier', 'Eva', 'Kai', 'Everleigh', 'Jose', 'Madeline', 'Parker', 'Lydia', 'Adam', 'Jade', 'Jace', 'Peyton', 'Wesley', 'Brielle', 'Kayden', 'Adeline', 'Silas', 'Vivian', 'Bennett', 'Rylee', 'Declan', 'Clara', 'Waylon', 'Raelynn', 'Weston', 'Melanie', 'Evan', 'Melody', 'Emmett', 'Julia', 'Micah', 'Athena', 'Ryder', 'Maria', 'Beau', 'Liliana', 'Damian', 'Hadley', 'Hadley', 'Brayden', 'Arya', 'Gael', 'Rose', 'Rowan', 'Reagan', 'Harrison', 'Eliza', 'Bryson', 'Adalynn', 'Adalynn', 'Sawyer', 'Kaylee', 'Amir', 'Lyla', 'Kingston', 'Mackenzie', 'Jason', 'Alaia', 'Giovanni', 'Isabelle', 'Vincent', 'Charlie', 'Ayden', 'Arianna', 'Chase', 'Mary', 'Myles', 'Myles', 'Remi', 'Diego', 'Margaret', 'Nathaniel', 'Iris', 'Legend', 'Parker', 'Jonah', 'Ximena', 'River', 'Eden', 'Tyler', 'Ayla', 'Cole', 'Kylie', 'Braxton', 'Elliana', 'George', 'Josie', 'Milo', 'Katherine', 'Zachary', 'Faith', 'Ashton', 'Alexandra', 'Luis', 'Eloise', 'Jasper', 'Adalyn', 'Adalyn', 'Kaiden', 'Amaya', 'Adriel', 'Jasmine', 'Gavin', 'Amara', 'Bentley', 'Daisy', 'Calvin', 'Reese', 'Zion', 'Valerie', 'Juan', 'Brianna', 'Maxwell', 'Cecilia', 'Max', 'Andrea', 'Ryker', 'Summer', 'Carlos', 'Valeria', 'Emmanuel', 'Norah', 'Jayce', 'Ariella', 'Lorenzo', 'Esther', 'Ivan', 'Ashley', 'Jude', 'Emerson', 'August', 'August', 'Aubree', 'Kevin', 'Isabel', 'Malachi', 'Anastasia', 'Elliott', 'Genevieve', 'Jesus', 'Alina', 'Maddox', 'Bailey', 'King', 'Juniper', 'Theo', 'Maeve']; //pre(count($names)); for ($i = 0; $i < 100; $i++) { $mobile = $names[rand(0,225)] . '_' . rand(1000, 9999); pre($mobile); } } }