123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625 |
- <?php
- namespace app\index\controller;
- use app\index\model\ShareKey;
- use app\index\service\passport\MailCaptcha as MailCaptchaService;
- use app\index\model\OrderAddress;
- use app\index\model\user\PointsLog as PointsLogModel;
- use app\index\model\Goods as GoodsModel;
- use app\index\model\Order as OrderModel;
- use app\store\model\Express as ExpressModel;
- use think\facade\Log;
- use think\facade\Session;
- /**
- * 默认控制器
- * Class User
- * @package app\api\controller
- */
- class User extends Controller
- {
- /**
- * 个人中心
- * @return \think\response\View
- */
- public function personal()
- {
- $userId = Session::get('user_id');
- if (empty($userId)) {
- return view('passport/logIn');
- }
- $goodsModel = new GoodsModel();
- //$goods['content'] = html_entity_decode($goods['content']);
- return view('order', ['goods' => []]);
- }
- /**
- * 我的订单页面
- * @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.');
- }
- /**
- * 生成马甲号
- * @return \think\response\Json
- * @throws \Exception
- */
- 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'];
- $salt = 'xxxxxx';
- $password = md5('123456' . $salt);
- for ($i = 0; $i < 100; $i++) {
- $user = [];
- $temp = $names[rand(0, 225)] . '_' . rand(100000, 999999);
- $user['mobile'] = $temp . '@fvp.com';
- $user['nick_name'] = $temp;
- $user['avatar_id'] = 0;
- $user['gender'] = 1;
- $user['country'] = 'US';
- $user['province'] = '';
- $user['city'] = '';
- $user['address_id'] = 0;
- $user['balance'] = 0;
- $user['points'] = 0;
- $user['pay_money'] = 0;
- $user['expend_money'] = 0;
- $user['platform'] = 'h5';
- $user['last_login_time'] = time();
- $user['is_delete'] = 0;
- $user['store_id'] = 10001;
- $user['create_time'] = time();
- $user['update_time'] = time();
- $user['salt'] = $salt;
- $user['password'] = $password;
- $users[] = $user;
- }
- $userModel = new \app\index\model\User();
- $userModel->saveAll($users);
- return $this->renderSuccess([], 'Successful!');
- }
- public function genGoodsComments()
- {
- $others = ['very realistic',];
- $favor = ['tastes very good',
- 'like fresh strawberries',
- 'refreshing but not overwhelming',
- 'very refreshing',
- 'tastes like enjoying a cup of hot cocoa',
- 'completely different from the bitterness and throat irritation of traditional cigarettes',
- 'different favor',
- "Tastes like enjoying a cup of hot cocoa, warm and delightful.",
- "addictive!",
- "Feels like biting into a fresh apple, crisp and delicious.",
- "There's a subtle vanilla flavor, making you feel like you're in a garden.",
- "Tastes like caramel with a delicate sweetness.",
- "It feels like savoring the aroma of freshly baked bread, absolutely tantalizing.",
- "Tastes like sipping on a tangy-sweet lemonade.",
- "There's a refreshing oceanic taste, making you feel like you're on the beach.",
- "The taste of this electronic product is like fresh grass, uplifting.",
- "It feels like tasting the richness of coffee.",
- "Feels like indulging in a mouthful of creamy ice cream, smooth and delicious.",
- "Tastes a bit like smelling a bouquet of fresh roses.",
- "Feels like tasting the aroma of freshly baked bread.",
- "There's a rich chocolate flavor, making you feel like you're in heaven.",
- "The taste of this electronic product is like a fresh fruit platter, delightful in every way.",
- "The taste is like savoring a mouthful of sweet honey.",
- "Feels like enjoying a cup of mild tea, warm and comforting.",
- "Tastes like indulging in a sweet and chilled fruit juice.",
- "There's a refreshing herbal taste, making you feel refreshed.",
- "Feels like savoring a cup of rich Italian coffee, strong and aromatic.",
- "The taste is like enjoying a dense chocolate cake.",
- "Feels like being surrounded by the scent of flowers in a garden.",
- "Tastes a bit like biting into a fresh watermelon, sweet and juicy.",
- "There's a cool minty flavor, instantly refreshing.",
- "Feels like savoring a cup of aromatic latte, full of vitality.",
- "Tastes like indulging in a sweet marshmallow.",
- "Feels like enjoying a tangy-sweet lemon tea.",
- "Tastes a bit like sipping on a fresh coconut water, sweet and refreshing.",
- "There's a subtle vanilla flavor, uplifting the mood.",
- "Feels like savoring a rich chocolate cake, delicious and delightful.",
- "Tastes like enjoying a cool scoop of ice cream.",
- "Feels like being surrounded by the scent of fresh flowers.",
- "Tastes a bit like indulging in a scoop of fresh strawberry ice cream.",
- "There's a rich coffee flavor, making you feel energetic.",
- "Feels like savoring a cup of steaming hot black tea, warm and comforting.",
- "Tastes like indulging in a rich chocolate cake.",
- "Feels like enjoying a cup of sweet coconut milkshake.",
- "Tastes a bit like savoring a fresh blueberry ice cream.",
- "There's a subtle herbal taste, making you feel connected to nature.",
- "Feels like savoring a cup of aromatic mocha coffee, with fragrance filling the air.",
- "Tastes like enjoying a smooth scoop of mango ice cream.",
- "Feels like bathing in the refreshing scent of oranges.",
- "Tastes a bit like indulging in a sweet fruit salad.",
- 'very rich',
- 'So rich',
- 'Very delicate',
- 'So Delicate',
- 'Fresh',
- 'Pleasant',
- 'Refreshing',
- 'Robust',
- 'Aromatic',
- 'So Clean',
- 'Clean',
- 'Mild',
- 'Very Sweet',
- 'So Smooth',
- 'Mellow',
- 'Fragrant',
- 'So Warm',
- 'Intense',
- 'Light',
- 'Velvety',
- 'Deep',
- 'So deep',
- 'Satisfying',
- 'Subtle sweetness',
- 'Minty freshness',
- 'Luscious',
- 'Sweet-tasting',
- 'Long-lasting aftertaste',
- 'Zesty',
- 'Pure',
- 'Very Pure',
- 'Silky',
- 'Very Silky',
- 'Fiery',
- 'Icy',
- 'Very Icy',
- 'Exquisite fragrance',
- 'Comforting',
- 'Honeyed',
- 'Strong',
- 'So Strong, I like it',
- 'Balanced acidity',
- 'Subtle',
- 'Silken',
- 'Smooth and mellow',
- 'Creamy',
- 'Rich flavor',
- 'Delicious',
- 'Richly fragrant',
- 'Comfortable',
- 'Tasty',
- 'Tasty good',
- 'Full-bodied',
- 'Fresh and invigorating',
- 'Refreshing',
- 'Pleasing to the palate',
- 'Crisp',
- 'Complex',
- 'Satisfying',
- ];
- $price = [
- 'Affordable',
- 'Budget-friendly',
- 'Inexpensive',
- 'Economical',
- 'Cost-effective',
- 'Reasonably priced',
- 'Wallet-friendly',
- 'Cheap',
- 'Low-cost',
- 'Pocket-friendly',
- 'Bargain',
- 'Value for money',
- 'Dirt cheap',
- 'Cost-efficient',
- 'Discounted',
- 'Thrifty',
- 'Economically priced',
- 'Within budget',
- 'Modestly priced',
- 'Frugal',
- 'Low-priced',
- 'Marked down',
- 'Unbeatable price',
- 'Discounted rate',
- 'Value-priced',
- 'Competitive pricing',
- 'Affordable option',
- 'Great value',
- 'Rock-bottom prices',
- 'Cost-conscious',
- 'Sale price',
- 'Reasonable cost',
- 'Budget-conscious',
- 'Discount pricing',
- 'Low-priced option',
- 'Wallet-friendly choice',
- 'Entry-level pricing',
- 'Discounted deal',
- 'Cost-saving',
- 'Discounted rate',
- 'Sale bargain',
- 'Unmatched value',
- 'Unbelievably cheap',
- 'Steal deal',
- 'Slashed prices',
- 'Reduced rate',
- 'Great deal',
- 'Budget-friendly option',
- 'Money-saving',
- 'On a budget',
- ];
- $amount = ['the amount of smoke is very large', 'very large', 'On sale',
- 'Abundant',
- 'Plentiful',
- 'Ample',
- 'Copious',
- 'Generous',
- 'Substantial',
- 'Bountiful',
- 'Overflowing',
- 'Profuse',
- 'Plenty',
- 'Rich in quantity',
- 'Prolific',
- 'Luxuriant',
- 'In abundance',
- ];
- $delivery = [];
- $end = ['good', 'my favorite'];
- $pool = [
- 'The taste of this e-cigarette is really great, completely different from the bitterness and throat irritation of traditional cigarettes.',
- 'The smoke effect of electronic cigarettes is very realistic, as if I can truly feel the pleasure of smoking, and the amount of smoke is very large, so I can enjoy the smoking experience for a long time.',
- 'After switching to e-cigarettes, I found that my body seemed to be healthier and there was no intake of harmful substances like traditional cigarettes. It was really great.',
- 'Electronic cigarettes are very environmentally friendly, do not produce smoke, and have no negative impact on the environment, which makes me feel very proud.',
- 'very portable', ' I can use them anytime, anywhere. They are very convenient, and I no longer have to worry about not finding an ashtray.'
- ];
- }
- }
|