|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\index\controller;
|
|
|
|
|
|
+use app\index\model\Goods;
|
|
|
use app\index\model\ShareKey;
|
|
|
use app\index\service\passport\MailCaptcha as MailCaptchaService;
|
|
|
use app\index\model\OrderAddress;
|
|
@@ -429,10 +430,19 @@ class User extends Controller
|
|
|
return $this->renderSuccess([], 'Successful!');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 评论生成器
|
|
|
+ * @return \think\response\Json
|
|
|
+ * @throws \Exception
|
|
|
+ */
|
|
|
public function genGoodsComments()
|
|
|
{
|
|
|
- $others = ['very realistic',];
|
|
|
- $favor = ['tastes very good',
|
|
|
+ //113
|
|
|
+ $favor = [
|
|
|
+ 'very realistic',
|
|
|
+ 'I no longer have to worry about not finding an ashtray.',
|
|
|
+ 'very portable',
|
|
|
+ 'tastes very good',
|
|
|
'like fresh strawberries',
|
|
|
'refreshing but not overwhelming',
|
|
|
'very refreshing',
|
|
@@ -541,7 +551,9 @@ class User extends Controller
|
|
|
'Crisp',
|
|
|
'Complex',
|
|
|
'Satisfying',
|
|
|
+ 'very realistic',
|
|
|
];
|
|
|
+ //50
|
|
|
$price = [
|
|
|
'Affordable',
|
|
|
'Budget-friendly',
|
|
@@ -594,12 +606,17 @@ class User extends Controller
|
|
|
'Money-saving',
|
|
|
'On a budget',
|
|
|
];
|
|
|
- $amount = ['the amount of smoke is very large', 'very large', 'On sale',
|
|
|
+ //22
|
|
|
+ $amount = ['the amount of smoke is very large',
|
|
|
+ 'very large',
|
|
|
+ 'On sale',
|
|
|
'Abundant',
|
|
|
'Plentiful',
|
|
|
+ 'this vapor is plentiful',
|
|
|
'Ample',
|
|
|
'Copious',
|
|
|
'Generous',
|
|
|
+ 'Generous vapor',
|
|
|
'Substantial',
|
|
|
'Bountiful',
|
|
|
'Overflowing',
|
|
@@ -609,17 +626,54 @@ class User extends Controller
|
|
|
'Prolific',
|
|
|
'Luxuriant',
|
|
|
'In abundance',
|
|
|
+ 'good',
|
|
|
+ 'my favorite',
|
|
|
+ 'will buy again'
|
|
|
];
|
|
|
- $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.'
|
|
|
- ];
|
|
|
+ /* $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.'
|
|
|
+ ];*/
|
|
|
+ $goodsModel = new Goods();
|
|
|
+ $goods = $goodsModel->getListSimple()->toArray();
|
|
|
+ $score = [40, 50];
|
|
|
+ //所有的马甲号userid
|
|
|
+ $userModel = new \app\index\model\User();
|
|
|
+ $userIds = $userModel->where('salt', 'xxxxxx')->column('user_id');
|
|
|
+ $userNum = count($userIds);
|
|
|
+
|
|
|
+ $now = time();
|
|
|
+ $commentModel = new \app\index\model\Comment();
|
|
|
+ foreach ($goods as $item) {
|
|
|
+ $commentsNum = rand(30, 100);
|
|
|
+ $comments = [];
|
|
|
+ for ($i = 0; $i < $commentsNum; $i++) {
|
|
|
+
|
|
|
+ $comment = [
|
|
|
+ 'score' => $score[rand(0, 1)],
|
|
|
+ 'content' => $favor[rand(0, 112)] . ', ' . $price[rand(0, 49)] . ', ' . $amount[rand(0, 21)],
|
|
|
+ 'is_picture' => 0,
|
|
|
+ 'status' => 1,
|
|
|
+ 'sort' => rand(0, 99),
|
|
|
+ 'user_id' => $userIds[rand(0, $userNum - 1)],
|
|
|
+ 'order_id' => 0,
|
|
|
+ 'goods_id' => $item['goods_id'],
|
|
|
+ 'order_goods_id' => 0,
|
|
|
+ 'store_id' => 10001,
|
|
|
+ 'is_delete' => 0,
|
|
|
+ 'create_time' => $now,
|
|
|
+ 'update_time' => $now,
|
|
|
+ ];
|
|
|
+ $comments[] = $comment;
|
|
|
+ }
|
|
|
+
|
|
|
+ $commentModel->saveAll($comments);
|
|
|
+ }
|
|
|
+ return $this->renderSuccess([], 'Successful!');
|
|
|
}
|
|
|
|
|
|
}
|