MassagerService.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <?php
  2. namespace app\api\service;
  3. use app\admin\model\dynamic\Dynamic;
  4. use app\admin\model\dynamic\Like;
  5. use app\api\model\massager\Massager;
  6. use app\api\model\massager\Collect;
  7. use app\api\model\massager\Comment;
  8. use app\api\model\massager\Work;
  9. use app\api\model\massager\WorkPeriod;
  10. use app\api\model\order\Order;
  11. use app\api\model\service\Service;
  12. use redis\RedisClient;
  13. class MassagerService extends BaseService
  14. {
  15. private $massagerModel;
  16. private $colletModel;
  17. private $commentModel;
  18. private $orderModel;
  19. private $workModel;
  20. public function __construct()
  21. {
  22. $this->massagerModel = new Massager();
  23. $this->colletModel = new Collect();
  24. $this->commentModel = new Comment();
  25. $this->orderModel = new Order();
  26. $this->workModel = new Work();
  27. }
  28. /**
  29. * 合并助教数据代码
  30. * @param $paginate
  31. * @param $user_id
  32. * @return array
  33. */
  34. private function mergeMassager($paginate, $user_id)
  35. {
  36. $items = $paginate->items();
  37. $collet_relation = [];
  38. if ($user_id) {
  39. $collet_relation = $this->colletModel->fetchByUserIdAndMassagerIds($user_id, array_map(function ($data) {
  40. return $data['id'];
  41. }, $items));
  42. $collet_relation = array_reduce($collet_relation, function ($p, $cur) {
  43. $p[$cur['massager_id']] = 1;
  44. return $p;
  45. }, []);
  46. }
  47. $services = (new \app\admin\model\Service())->where([
  48. "duration_minute" => 120,
  49. "type" => \E_SERVICE_TYPE::App,
  50. ])->select();
  51. $services = array_reduce($services, function ($p, $cur) {
  52. $p[$cur["level"]] = $cur["real_price"];
  53. return $p;
  54. }, []);
  55. foreach ($items as &$item) {
  56. $recently_work_date = $this->workDateRange(array_map(function ($data) {
  57. return [strtotime($data["service_start_date"]), strtotime($data["service_end_date"])];
  58. }, $item["nearly_two_days_orders"]), true);
  59. $item['recently_work_date'] = $recently_work_date;
  60. $item['is_can_collet'] = !isset($collet_relation[$item['id']]);
  61. $item["price"] = isset($services[$item['level']]) ? $services[$item['level']] : 260;
  62. unset($item['nearly_two_days_orders']);
  63. }
  64. return [
  65. array_map(function ($data) {
  66. return Massager::fmtMassager($data);
  67. }, $items),
  68. $paginate->total()
  69. ];
  70. }
  71. /**
  72. * 判断是否能够选择
  73. * @param $in_time
  74. * @param $ranges
  75. * @return bool
  76. */
  77. private function checkCanOption($in_time, $ranges)
  78. {
  79. foreach ($ranges as $range) {
  80. if ($in_time >= $range[0] && $in_time <= $range[1]) {
  81. return false;
  82. }
  83. }
  84. return true;
  85. }
  86. /**
  87. * 获取可助教工作的时间段
  88. * @param array $order_date_range
  89. * @param bool $recently
  90. * @return array|false|string|null
  91. */
  92. private function workDateRange(array $order_date_range, $recently = true)
  93. {
  94. $now_time = time();
  95. $range = [];
  96. $max_time = strtotime(date("Y-m-d 23:59:59"));
  97. $acc_time = $now_time;
  98. $recently_work_date = null;
  99. while (true) {
  100. if ($acc_time === $now_time) {
  101. $y_m_d = date("Y-m-d", $acc_time);
  102. $now_minute = date("i", $acc_time);
  103. if ($now_minute < 30) {
  104. $range["$y_m_d"] = ["date" => $y_m_d, "range" => [["value" => date("H:30", $acc_time), "can_option" => false]]];
  105. }
  106. }
  107. $acc_time += (60 * 60);
  108. $y_m_d = date("Y-m-d", $acc_time);
  109. $y_m_d_h = date("Y-m-d H:00:00", $acc_time);
  110. $v_1 = [
  111. "value" => date("H:00", strtotime($y_m_d_h)),
  112. "can_option" => (($acc_time - (60 * 60)) === $now_time) ? false : $this->checkCanOption(strtotime($y_m_d_h), $order_date_range)
  113. ];
  114. $v_2 = [
  115. "value" => date("H:30", $acc_time),
  116. "can_option" => $this->checkCanOption($acc_time + (30 * 60), $order_date_range)
  117. ];
  118. if ($recently) {
  119. if ($v_1["can_option"]) {
  120. $recently_work_date = "$y_m_d_h";
  121. break;
  122. }
  123. if ($v_2["can_option"]) {
  124. $recently_work_date = date("Y-m-d H:30:00", $acc_time);
  125. break;
  126. }
  127. }
  128. if (isset($range["$y_m_d"])) {
  129. array_push($range["$y_m_d"]["range"], $v_1, $v_2);
  130. } else {
  131. $range["$y_m_d"] = [
  132. "date" => $y_m_d,
  133. "range" => [$v_1, $v_2]
  134. ];
  135. }
  136. if ($acc_time >= $max_time) break;
  137. }
  138. if ($recently) {
  139. return $recently_work_date;
  140. }
  141. $format_range = [];
  142. $keys = array_keys($range);
  143. for ($i = 0; $i <= count($keys) - 1; $i++) {
  144. $key = $keys[$i];
  145. $format_range[$i] = $range[$key];
  146. }
  147. return $format_range;
  148. }
  149. /**
  150. * 获取App助教
  151. * @param null $user_id
  152. * @param array $params
  153. * @param $gender
  154. * @return array
  155. */
  156. public function fetchAppMassager($user_id, array $params, $gender)
  157. {
  158. $paginate = $this->massagerModel->fetchAppMassager(
  159. $params['city_code'],
  160. $params['lng_lat'],
  161. isset($params['search_text']) && mb_strlen($params['search_text']) > 0 ? $params['search_text'] : null,
  162. isset($params['distance']) && is_numeric($params["distance"]) ? $params['distance'] : 300,
  163. isset($params['service_status']) && is_numeric($params['service_status']) ? $params['service_status'] : null,
  164. $gender,
  165. isset($params['free_travel']) && is_numeric($params['free_travel']) ? $params['free_travel'] : null,
  166. isset($params['hot']) && is_numeric($params['hot']) ? $params['hot'] : null,
  167. isset($params['service_id']) && is_numeric($params['service_id']) ? $params['service_id'] : null,
  168. $params['sort'] ?? null,
  169. $params['page'] ?? 1,
  170. $params['size'] ?? 10,
  171. $user_id,
  172. isset($params['level']) && is_numeric($params['level']) ? $params['level'] : null
  173. );
  174. return $this->mergeMassager($paginate, $user_id);
  175. }
  176. /**
  177. * 获取球房助教
  178. * @param array $params
  179. * @param $gender
  180. * @param null $user_id
  181. * @return array
  182. */
  183. public function fetchStoreMassager(array $params, $gender, $user_id = null)
  184. {
  185. $paginate = $this->massagerModel->fetchStoreMassager(
  186. $params['store_id'],
  187. $params['service_id'] ?? null,
  188. $params['search_text'] ?? null,
  189. $params['hot'] ?? null,
  190. $gender,
  191. $params['page'] ?? 1,
  192. $params['size'] ?? 10
  193. );
  194. return $this->mergeMassager($paginate, $user_id);
  195. }
  196. /**
  197. * 获取助教上班的的时间
  198. * @param $id
  199. * @return |null
  200. */
  201. public function getWorkDateRange($id)
  202. {
  203. $massager = $this->massagerModel->getMassager($id, ["store", "nearlyTwoDaysOrders"]);
  204. if (!$massager)
  205. return $this->ok([]);
  206. $order_date_range = array_map(function ($data) {
  207. return [strtotime($data["service_start_date"]), strtotime($data["service_end_date"])];
  208. }, $massager["nearlyTwoDaysOrders"]);
  209. $no_work_ranges = (new WorkPeriod())->where("massager_id", $id)->where("end_time", ">", time())->select();
  210. $ranges_ = array_map(function ($data) {
  211. return [$data["start_time"], $data["end_time"]];
  212. }, $no_work_ranges);
  213. $range = $this->workDateRange(array_merge($order_date_range, $ranges_), false);
  214. return $this->ok([
  215. "id" => $massager->id,
  216. "range" => $range
  217. ]);
  218. }
  219. /**
  220. * 获取单个助教详情
  221. * @param $massager_id
  222. * @param null $user_id
  223. * @return |null
  224. */
  225. public function get($massager_id, $user_id = null, $is_add_clock = null)
  226. {
  227. $massager = $this->massagerModel->fetchHiddenAndNormal($massager_id);
  228. if (null === $massager)
  229. return null;
  230. $massager['is_can_collet'] = true;
  231. if ($user_id) {
  232. $relation = $this->colletModel->getByUserIdAndMassagerId($user_id, $massager_id);
  233. if ($relation)
  234. $massager['is_can_collet'] = false;
  235. }
  236. $serviceModel = new Service();
  237. $query = $serviceModel
  238. ->where([
  239. "level" => $massager["level"],
  240. "type" => \E_SERVICE_TYPE::App
  241. ]);
  242. if ($is_add_clock != 1) {
  243. $query->where("is_add_clock", 0);
  244. }
  245. $exist = null;
  246. $items = collection($query
  247. ->order('sort', 'desc')
  248. ->order('real_price', 'ASC')->select())->toArray();
  249. $membership_discount_rate = config("site.membership_discount_rate") / 100;
  250. $available_services = [];
  251. foreach ($items as &$item) {
  252. $item["membership_discount_price"] = fixed2Float($item["real_price"] * $membership_discount_rate);
  253. if ($item["id"] != 276) {
  254. $available_services[] = $item;
  255. } else {
  256. if ($massager["store_id"] == $exist && $exist > 0) {
  257. $available_services[] = $item;
  258. }
  259. }
  260. }
  261. $massager["services"] = $available_services;
  262. return Massager::fmtMassager($massager);
  263. }
  264. /**
  265. * @param $massager_id
  266. * @param $page
  267. * @param $size
  268. * @return array
  269. * @throws \think\exception\DbException
  270. */
  271. public function fetchMassagerComment($massager_id, $page, $size)
  272. {
  273. $paginate = $this->commentModel->fetchByMassagerId($massager_id, $page, $size);
  274. $items = $paginate->items();
  275. return [
  276. array_map(function ($data) {
  277. $nickname = "匿名用户";
  278. $avatar = null;
  279. if ($data['user'] && 0 == $data['is_anonymity']) {
  280. $nickname = $data['user']['nickname'];
  281. $avatar = $data['user']['avatar'];
  282. }
  283. $data['user_nickname'] = $nickname;
  284. $data['user_avatar'] = $avatar;
  285. unset($data['user']);
  286. return $data;
  287. }, $items),
  288. $paginate->total()
  289. ];
  290. }
  291. public function getMassagerTentativeNowLevelConfiguration($m_id, $city_code, $intraday = null)
  292. {
  293. $configuration = [
  294. [0, 50],
  295. [300, 60],
  296. [500, 65],
  297. [700, 70]
  298. ];
  299. $level_index = 1;
  300. $profit_rate = 50;
  301. $next_configuration = 288;
  302. $sumPerformanceByNowMonth = $this->orderModel->sumPerformanceByIntraday($m_id, $city_code, $intraday);
  303. if ($sumPerformanceByNowMonth > $configuration[0][0]) {
  304. for ($index = 0; $index < count($configuration); $index++) {
  305. $item = $configuration[$index];
  306. if ($sumPerformanceByNowMonth > $item[0]) {
  307. $level_index += 1;
  308. $profit_rate = $item[1];
  309. $next_configuration = isset($configuration[$index + 1]) ? $configuration[$index + 1][0] : null;
  310. }
  311. }
  312. $level_index -= 1;
  313. }
  314. return [
  315. "level" => $level_index,
  316. "profit_rate" => $profit_rate,
  317. "next_configuration" => $next_configuration,
  318. "sum_performance_by_now_month" => $sumPerformanceByNowMonth,
  319. ];
  320. }
  321. public function getMassagerNowLevelConfiguration($m_id, $city_code, $y = null, $m = null)
  322. {
  323. $configuration = array_map(function ($data) {
  324. $performance = explode("|", $data["月业绩/元"]);
  325. $duration = explode("|", $data["在岗时长/小时"]);
  326. $reorder = explode("|", $data["加钟比例(%)"]);
  327. $praise = explode("|", $data["好评率(%)"]);
  328. $chargeback = explode("|", $data["退单率(%)"]);
  329. return [
  330. [
  331. "condition" => isset($performance[0]) && is_numeric($performance[0]) ? (float)$performance[0] : 6500,
  332. "rate" => isset($performance[1]) && is_numeric($performance[1]) ? (float)$performance[1] : 55
  333. ],
  334. [
  335. "condition" => isset($duration[0]) && is_numeric($duration[0]) ? (float)$duration[0] : 100,
  336. "rate" => isset($duration[1]) && is_numeric($duration[1]) ? (float)$duration[1] : 1
  337. ],
  338. [
  339. "condition" => isset($reorder[0]) && is_numeric($reorder[0]) ? (float)$reorder[0] : 30,
  340. "rate" => isset($reorder[1]) && is_numeric($reorder[1]) ? (float)$reorder[1] : 1
  341. ],
  342. [
  343. "condition" => isset($praise[0]) && is_numeric($praise[0]) ? (float)$praise[0] : 30,
  344. "rate" => isset($praise[1]) && is_numeric($praise[1]) ? (float)$praise[1] : 1
  345. ],
  346. [
  347. "condition" => isset($chargeback[0]) && is_numeric($chargeback[0]) ? (float)$chargeback[0] : 30,
  348. "rate" => isset($chargeback[1]) && is_numeric($chargeback[1]) ? (float)$chargeback[1] : -1
  349. ]
  350. ];
  351. }, [
  352. config("site.massager_level_1"),
  353. config("site.massager_level_2"),
  354. config("site.massager_level_3"),
  355. config("site.massager_level_4"),
  356. config("site.massager_level_5"),
  357. ]);
  358. $sumPerformanceByNowMonth = $this->orderModel->sumPerformanceByNowMonth($m_id, $city_code, $y, $m);
  359. $sumDurationByNowMonth = $this->workModel->sumByNowMonth($m_id, $y, $m);
  360. $reorderRateByNowMonth = $this->orderModel->reorderRateByNowMonth($m_id, $city_code, $y, $m);
  361. $praiseRateByNowMonth = $this->orderModel->countByPraiseRate($m_id, $city_code, $y, $m);
  362. $chargebackRateByNowMonth = $this->orderModel->chargebackRate($m_id, $city_code, $y, $m);
  363. $profit_rate = config("site.massager_basics_deposit_rate") ?? 50;
  364. $level_index = 0;
  365. $next_configuration = null;
  366. for ($i = 0; $i < count($configuration); $i++) {
  367. $now_configuration = $configuration[$i];
  368. if ($sumPerformanceByNowMonth >= $now_configuration[0]["condition"]) {
  369. $level_index += 1;
  370. $next_configuration = isset($configuration[$i + 1]) ? $configuration[$i + 1] : null;
  371. $profit_rate = $now_configuration[0]["rate"];
  372. $profit_rate += ($sumDurationByNowMonth >= $now_configuration[1]["condition"] ? $now_configuration[1]["rate"] : 0);
  373. $profit_rate += ($reorderRateByNowMonth >= $now_configuration[2]["condition"] ? $now_configuration[2]["rate"] : 0);
  374. $profit_rate += ($praiseRateByNowMonth >= $now_configuration[3]["condition"] ? $now_configuration[3]["rate"] : 0);
  375. $profit_rate += ($chargebackRateByNowMonth >= $now_configuration[4]["condition"] ? $now_configuration[4]["rate"] : 0);
  376. } else {
  377. break;
  378. }
  379. }
  380. return [
  381. "level" => $level_index,
  382. "profit_rate" => $profit_rate,
  383. "next_configuration" => $next_configuration,
  384. "sum_performance_by_now_month" => $sumPerformanceByNowMonth,
  385. ];
  386. }
  387. public function getProfitRate($m_id, $city_code, $y = null, $m = null, $intraday = null): float
  388. {
  389. $massager = $this->massagerModel->findById($m_id);
  390. if (!$massager)
  391. return 0;
  392. if ($massager["fixed_profit_rate"] > 0)
  393. return $massager["fixed_profit_rate"];
  394. // DOTO: 临时替换
  395. $level_info = $this->getMassagerTentativeNowLevelConfiguration($m_id, $city_code, $intraday);
  396. // $level_info = $this->getMassagerNowLevelConfiguration($m_id, $city_code, $y, $m);
  397. return $level_info["profit_rate"];
  398. }
  399. public function interiorScoreLevel($score)
  400. {
  401. $config = config("site.massager_review_level");
  402. $keys = array_keys($config);
  403. $level_desc = "不及格";
  404. foreach ($keys as $key) {
  405. if ($score >= (float)$key) {
  406. $level_desc = $config[$key];
  407. } else {
  408. break;
  409. }
  410. }
  411. return $level_desc;
  412. }
  413. public function updateInteriorScore($m_id, $year, $month)
  414. {
  415. $config = config("site.massager_review_score");
  416. $fmt_config = [
  417. "duration" => explode("|", $config["时长/天"] ?? "6|2"),
  418. "praise" => explode("|", $config["评论/好评"] ?? "1|2"),
  419. "negative" => explode("|", $config["评论/差评"] ?? "1|-10"),
  420. "performance" => explode("|", $config["业绩/天"] ?? "500|2"),
  421. "reorder" => explode("|", $config["项目加钟"] ?? "1|2")
  422. ];
  423. $byDuration = $this->interiorScoreByDuration($m_id, $year, $month, $fmt_config["duration"]);
  424. $byPraise = $this->interiorScoreByPraise($m_id, $year, $month, $fmt_config["praise"]);
  425. $byNegative = $this->interiorScoreByNegative($m_id, $year, $month, $fmt_config["negative"]);
  426. $byPerformance = $this->interiorScoreByPerformance($m_id, $year, $month, $fmt_config["performance"]);
  427. $byReorder = $this->interiorScoreByReorder($m_id, $year, $month, $fmt_config["reorder"]);
  428. $total_score = fixed2Float(
  429. $byDuration["score"]
  430. + $byPraise["score"]
  431. + $byNegative["score"]
  432. + $byPerformance["score"]
  433. + $byReorder["score"]
  434. );
  435. if (date("Y") == $year && date("m") == $month) {
  436. $this->massagerModel->update([
  437. "interior_score" => $total_score
  438. ], ["id" => $m_id]);
  439. }
  440. return [
  441. "total_interior_score" => $total_score,
  442. "level_desc" => $this->interiorScoreLevel($total_score),
  443. "items" => [
  444. "byDuration" => $byDuration,
  445. "byPraise" => $byPraise,
  446. "byNegative" => $byNegative,
  447. "byPerformance" => $byPerformance,
  448. "byReorder" => $byReorder
  449. ]
  450. ];
  451. }
  452. public function interiorScoreByDuration($m_id, $year, $month, $config)
  453. {
  454. $last_day = date("t", strtotime("$year-$month-01 00:00:00"));
  455. $starttime = strtotime("$year-$month-01 00:00:00");
  456. $endtime = strtotime("$year-$month-$last_day 23:59:59");
  457. $works = (new Work())
  458. ->where("massager_id", $m_id)
  459. ->where("clock_in_time", ">=", $starttime)
  460. ->where("clock_off_time", "<=", $endtime)
  461. ->select();
  462. $clocks_times = [];
  463. foreach ($works as $work) {
  464. $times = splittingDate($work["clock_in_time"], $work["clock_off_time"]);
  465. $clocks_times = array_merge($clocks_times, $times);
  466. }
  467. $clocks_times = array_merge(array_unique($clocks_times));
  468. $every_days = [];
  469. $DAY_TIME = 24 * 60 * 60;
  470. $start_time_copy = $starttime;
  471. while ($start_time_copy <= $endtime) {
  472. array_push($every_days, date("Y-m-d", $start_time_copy));
  473. $start_time_copy += $DAY_TIME;
  474. }
  475. $score = 0;
  476. $intersections = [];
  477. foreach ($every_days as $now_day) {
  478. $now_day_times = splittingDate(strtotime("$now_day 00:00:00"), strtotime("$now_day 23:59:59"));
  479. $intersection = array_intersect($now_day_times, $clocks_times);
  480. $meet = count($intersection) >= (fixed2Float((($config[0] ?? 6) * 60) / 10) + 1);
  481. if ($meet) {
  482. $intersections[] = [
  483. "date" => $now_day,
  484. "count" => count($intersection),
  485. ];
  486. $score += $config[1] ?? 2;
  487. }
  488. }
  489. return [
  490. "score" => fixed2Float($score),
  491. "details" => $intersections
  492. ];
  493. }
  494. public function interiorScoreByPraise($m_id, $year, $month, $config)
  495. {
  496. $negative = $this->commentModel->fetchPraiseCommentByMassager($m_id, $year, $month);
  497. $count = count($negative);
  498. $item_score = $config[1] / $config[0];
  499. return ["score" => fixed2Float($item_score * $count), "details" => $negative];
  500. }
  501. public function interiorScoreByNegative($m_id, $year, $month, $config)
  502. {
  503. $negative = $this->commentModel->fetchNegativeCommentByMassager($m_id, $year, $month);
  504. $count = count($negative);
  505. $item_score = $config[1] / $config[0];
  506. return ["score" => fixed2Float($item_score * $count), "details" => $negative];
  507. }
  508. public function interiorScoreByPerformance($m_id, $year, $month, $config)
  509. {
  510. $all_orders = $this->orderModel->fetchByMassager($m_id, $year, $month);
  511. $fmt = [];
  512. foreach ($all_orders as $order) {
  513. $key = date("Y-m-d", $order["pay_time"]);
  514. if (isset($fmt[$key])) {
  515. $fmt[$key] += $order["total_real_amount"];
  516. } else {
  517. $fmt[$key] = $order["total_real_amount"];
  518. }
  519. }
  520. $score = 0;
  521. $details = [];
  522. foreach ($fmt as $key => $value) {
  523. if ($value >= $config[0]) {
  524. $details[] = [
  525. "date" => $key,
  526. "count" => $value,
  527. ];
  528. $score += $config[1];
  529. }
  530. }
  531. return ["score" => fixed2Float($score), "details" => $details];
  532. }
  533. public function interiorScoreByReorder($m_id, $year, $month, $config)
  534. {
  535. $all_orders = $this->orderModel->fetchReorderByMassager($m_id, $year, $month);
  536. $count = count($all_orders);
  537. $item_score = $config[1] / $config[0];
  538. return ["score" => fixed2Float($item_score * $count), "details" => $all_orders];
  539. }
  540. public function fetchSelfDynamics($m_id, $page = 1, $size = 10)
  541. {
  542. $paginate = (new Dynamic())
  543. ->where("massager_id", $m_id)
  544. ->with(["comments", "likes"])
  545. ->page($page)
  546. ->paginate($size);
  547. return [
  548. $paginate->items(),
  549. $paginate->total()
  550. ];
  551. }
  552. public function fetchFansNumberAndPraiseNumber($m_id)
  553. {
  554. return [
  555. "fansNumber" => Collect::where("massager_id", $m_id)->count(),
  556. "praiseNumber" => Like::where("massager_id", $m_id)->count()
  557. ];
  558. }
  559. }