Task.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?php
  2. namespace app\controller\api\shareProsperity;
  3. use app\common\enum\CommonEnum;
  4. use app\common\repositories\shared\SharedProsperityTaskRepository;
  5. use think\facade\Db;
  6. class Task
  7. {
  8. // 合伙人分红
  9. public function partnerProfits()
  10. {
  11. $get = app()->request->get();
  12. /** @var SharedProsperityTaskRepository $repository */
  13. $repository = app()->make(SharedProsperityTaskRepository::class);
  14. $data = $repository->partner($get);
  15. return app('json')->success($data);
  16. }
  17. public function thankProfits()
  18. {
  19. $get = app()->request->get();
  20. /** @var SharedProsperityTaskRepository $repository */
  21. $repository = app()->make(SharedProsperityTaskRepository::class);
  22. $repository->thank($get);
  23. return app('json')->success();
  24. }
  25. public function groupProfits()
  26. {
  27. $get = app()->request->get();
  28. /** @var SharedProsperityTaskRepository $repository */
  29. $repository = app()->make(SharedProsperityTaskRepository::class);
  30. $data = $repository->group($get);
  31. return app('json')->success($data);
  32. }
  33. public function testProfits()
  34. {
  35. // 李玉枝 国宝中 秒简化 李守之 赵娜
  36. // 直推
  37. // $userData = [
  38. // 2393=>82.80,
  39. // 4324=>110.4,
  40. // 4073=>82.8,
  41. // 2540=>55.2,
  42. // 2950=>55.2
  43. //
  44. // ];
  45. // 总裁分红
  46. // $userData = [
  47. // // 李玉枝
  48. // 2393=>18,
  49. // // 国宝中
  50. // 4324=>15,
  51. // // 秒简化
  52. // 4073=>13,
  53. // // 李守之
  54. // 2540=>9,
  55. // // 赵娜
  56. // 2950=>9,
  57. // // xuliping
  58. // 43=>289,
  59. // // lisuhong
  60. // 62=>364,
  61. // // liuyinxia
  62. // 192=>408,
  63. // // 钟起群
  64. // 4758=>6,
  65. // // 王运香
  66. // 4033=>6,
  67. // // 李建生
  68. // 4348=>6,
  69. // // 张贵兰
  70. // 4245=>6,
  71. // // 黄远学
  72. // 4897=>6,
  73. // // 迟徳瑞
  74. // 4896=>6,
  75. // // 陶艺雯
  76. // 3160=>6,
  77. // // 王凤菲
  78. // 4898=>6,
  79. // // 张娜
  80. // 4899=>6,
  81. // // 刘洪军
  82. // 4656=>6,
  83. // // 金刚
  84. // 2846=>6,
  85. // // 刘亚娟没有手机号
  86. // ];
  87. // 万人团
  88. // $userData = [
  89. // // 国宝中
  90. // 4324 => 6,
  91. // // 秒简化
  92. // 4073 => 6,
  93. // // 李守之
  94. // 2540 => 6,
  95. // // 钟起群
  96. // 4758 => 6,
  97. // // 王运香
  98. // 4033 => 6,
  99. // // 李建生
  100. // 4348 => 6,
  101. // // 张贵兰
  102. // 4245 => 6,
  103. // // 黄远学
  104. // 4897 => 6,
  105. // // 迟徳瑞
  106. // 4896 => 6,
  107. // // 陶艺雯
  108. // 3160 => 6,
  109. // // 王凤菲
  110. // 4898 => 6,
  111. // // 张娜
  112. // 4899 => 6,
  113. // // 刘洪军
  114. // 4656 => 6,
  115. // // 金刚
  116. // 2846 => 6,
  117. // // 刘亚娟没有手机号
  118. // // xuliping
  119. // 43 => 66,
  120. // // lisuhong
  121. // 62 => 66,
  122. // // liuyinxia
  123. // 192 => 66,
  124. // ];
  125. // 2026-2-24合伙人总裁分红
  126. // $userData = [
  127. // 192 => 108,
  128. // 62 => 68,
  129. // 43 => 36,
  130. // 3 => 15,
  131. // 2393 => 15,
  132. // 2540 => 15,
  133. // 4001 => 15,
  134. // 4073 => 15,
  135. // 4899 => 15,
  136. // ];
  137. // 2026-2-24合伙人钻石分红
  138. // $userData = [
  139. // 1 => 21,
  140. // 54 => 21
  141. // ];
  142. // 2026-2-24 3星合伙人分红
  143. // $userData = [
  144. // 14 => 13,
  145. // 46 => 13
  146. // ];
  147. // 2026-2-24 2星合伙人分红 4.66
  148. // $userData = [
  149. // 45=>4.66,
  150. // 47=>4.66,
  151. // 48=>4.66,
  152. // 61=>4.66,
  153. // 67=>4.66,
  154. // 77=>4.66,
  155. // 79=>4.66,
  156. // 81=>4.66,
  157. // 103=>4.66,
  158. // 106=>4.66,
  159. // 190=>4.66,
  160. // 191=>4.66,
  161. // 193=>4.66,
  162. // 220=>4.66,
  163. // 221=>4.66,
  164. // 247=>4.66,
  165. // 261=>4.66,
  166. // 262=>4.66,
  167. // 267=>4.66,
  168. // 411=>4.66,
  169. // 425=>4.66,
  170. // 444=>4.66,
  171. // 461=>4.66,
  172. // 490=>4.66,
  173. // 508=>4.66,
  174. // 523=>4.66,
  175. // 587=>4.66,
  176. // 598=>4.66,
  177. // 599=>4.66,
  178. // 818=>4.66,
  179. // 911=>4.66,
  180. // 1213=>4.66,
  181. // 1894=>4.66,
  182. // 1954=>4.66,
  183. // 2009=>4.66,
  184. // 3661=>4.66,
  185. // 3976=>4.66,
  186. // 4323=>4.66,
  187. // 4557=>4.66,
  188. // 4587=>4.66,
  189. // 4590=>4.66,
  190. // 4637=>4.66,
  191. // 4741=>4.66,
  192. // ];
  193. // 2026-2-24 1星合伙人分红 6
  194. // $userData = [
  195. // 6 => 6,
  196. // 4838 => 6,
  197. // 16 => 6,
  198. // ];
  199. // 2026-2-24 万人团分红
  200. // $userData = [
  201. // 17=>5,
  202. // 22=>5,
  203. // 26=>5,
  204. // 39=>5,
  205. // 43=>18,
  206. // 47=>5,
  207. // 61=>5,
  208. // 67=>5,
  209. // 74=>5,
  210. // 75=>5,
  211. // 77=>5,
  212. // 79=>5,
  213. // 80=>5,
  214. // 89=>5,
  215. // 95=>5,
  216. // 103=>5,
  217. // 108=>5,
  218. // 109=>5,
  219. // 125=>5,
  220. // 133=>5,
  221. // 134=>5,
  222. // 135=>5,
  223. // 162=>5,
  224. // 186=>5,
  225. // 211=>5,
  226. // 228=>5,
  227. // 229=>5,
  228. // 230=>5,
  229. // 263=>5,
  230. // 264=>5,
  231. // 269=>5,
  232. // 272=>5,
  233. // 274=>5,
  234. // 284=>5,
  235. // 285=>5,
  236. // 288=>5,
  237. // 291=>5,
  238. // 292=>5,
  239. // 294=>5,
  240. // 296=>5,
  241. // 298=>5,
  242. // 303=>5,
  243. // 304=>5,
  244. // 311=>5,
  245. // 312=>5,
  246. // 314=>5,
  247. // 317=>5,
  248. // 321=>5,
  249. // 323=>5,
  250. // 324=>5,
  251. // 325=>5,
  252. // 326=>5,
  253. // 328=>5,
  254. // 330=>5,
  255. // 334=>5,
  256. // 335=>5,
  257. // 336=>5,
  258. // 341=>5,
  259. // 342=>5,
  260. // 351=>5,
  261. // 358=>5,
  262. // 360=>5,
  263. // 361=>5,
  264. // 362=>5,
  265. // 368=>5,
  266. // 376=>5,
  267. // 377=>5,
  268. // 381=>5,
  269. // 382=>5,
  270. // 383=>5,
  271. // 384=>5,
  272. // 387=>5,
  273. // 389=>5,
  274. // 390=>5,
  275. // 393=>5,
  276. // 394=>5,
  277. // 396=>5,
  278. // 397=>5,
  279. // 403=>5,
  280. // 409=>5,
  281. // 414=>5,
  282. // 423=>5,
  283. // 424=>5,
  284. // 425=>5,
  285. // 427=>5,
  286. // 428=>5,
  287. // 429=>5,
  288. // 431=>5,
  289. // 432=>5,
  290. // 433=>5,
  291. // 434=>5,
  292. // 435=>5,
  293. // 436=>5,
  294. // 442=>5,
  295. // 444=>5,
  296. // 450=>5,
  297. // 451=>5,
  298. // 452=>5,
  299. // 453=>5,
  300. // 454=>5,
  301. // 455=>5,
  302. // 456=>5,
  303. // 457=>5,
  304. // 458=>5,
  305. // 460=>5,
  306. // 462=>5,
  307. // 465=>5,
  308. // 466=>5,
  309. // 467=>5,
  310. // 471=>5,
  311. // 472=>5,
  312. // 473=>5,
  313. // 474=>5,
  314. // 475=>5,
  315. // 476=>5,
  316. // 478=>5,
  317. // 479=>5,
  318. // 480=>5,
  319. // 485=>5,
  320. // 486=>5,
  321. // 487=>5,
  322. // 489=>5,
  323. // 491=>5,
  324. // 492=>5,
  325. // 493=>5,
  326. // 494=>5,
  327. // 495=>5,
  328. // 496=>5,
  329. // 497=>5,
  330. // 500=>5,
  331. // 501=>5,
  332. // 502=>5,
  333. // 503=>5,
  334. // 504=>5,
  335. // 506=>5,
  336. // 507=>5,
  337. // 509=>5,
  338. // 511=>5,
  339. // 512=>5,
  340. // 513=>5,
  341. // 514=>5,
  342. // 515=>5,
  343. // 516=>5,
  344. // 517=>5,
  345. // 518=>5,
  346. // 519=>5,
  347. // 520=>5,
  348. // 522=>5,
  349. // 523=>5,
  350. // 524=>5,
  351. // 526=>5,
  352. // 530=>5,
  353. // 531=>5,
  354. // 534=>5,
  355. // 535=>5,
  356. // 540=>5,
  357. // 541=>5,
  358. // 542=>5,
  359. // 543=>5,
  360. // 544=>5,
  361. // 548=>5,
  362. // 549=>5,
  363. // 554=>5,
  364. // 555=>5,
  365. // 556=>5,
  366. // 557=>5,
  367. // 558=>5,
  368. // 561=>5,
  369. // 563=>5,
  370. // 567=>5,
  371. // 576=>5,
  372. // 589=>5,
  373. // 604=>5,
  374. // 3=>5,
  375. // 2540=>5,
  376. // 62=>18,
  377. // 192=>18,
  378. // 2393=>5,
  379. // 4001=>5,
  380. // 4073=>5,
  381. // 4899=>5
  382. // ];
  383. // 2026-3-2总裁分红
  384. // 刘银霞310元
  385. // 李素红208元
  386. // 徐丽萍98元
  387. // 李玉芝267元
  388. // 其他5个总裁每个人56元
  389. $userData = [
  390. 43 => 92,
  391. 62 => 208,
  392. 192 => 310,
  393. 3 => 56,
  394. 2393 => 267,
  395. 4001 => 56,
  396. 4073 => 56,
  397. 2540 => 56,
  398. 4899 => 56,
  399. ];
  400. foreach ($userData as $uid => $money) {
  401. $bill = [
  402. 'uid' => $uid,
  403. 'link_id' => 0,
  404. 'pm' => 1,
  405. 'title' => '共富总裁合伙人分红',
  406. 'category' => 'now_money',
  407. 'type' => 'commission',
  408. 'number' => $money,
  409. 'balance' => 0,
  410. 'mark' => '共富总裁合伙人分红',
  411. 'create_time' => date('Y-m-d H:i:s'),
  412. 'status' => 1,
  413. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
  414. 'order_sn' => 0,
  415. 'tripartite' => 0,
  416. 'type_shop' => 0,
  417. 'mer_id' => 0,
  418. 'source' => 0,
  419. 'order_type' => 1,
  420. 'is_red_brokerage' => 0,
  421. 'gzc' => 3,
  422. 'take_time' => time(),
  423. 'district_id' => '',
  424. 'street_id' => '',
  425. 'month' => '',
  426. ];
  427. $a = Db::name('user_bill')->insert($bill);
  428. $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
  429. }
  430. }
  431. public function share_prosperity_test_group()
  432. {
  433. $groupUser = Db::name('shared_prosperity_group_user')->where('group_id',1)->select()->toArray();
  434. $userData = array_column($groupUser,'user_id');
  435. $money = 1.26;
  436. foreach ($userData as $key => $uid) {
  437. $bill = [
  438. 'uid' => $uid,
  439. 'link_id' => 0,
  440. 'pm' => 1,
  441. 'title' => '共富万人团分红',
  442. 'category' => 'now_money',
  443. 'type' => 'commission',
  444. 'number' => $money,
  445. 'balance' => 0,
  446. 'mark' => '共富万人团分红',
  447. 'create_time' => date('Y-m-d H:i:s'),
  448. 'status' => 1,
  449. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_GROUP_COMMISSION']['code'],
  450. 'order_sn' => 0,
  451. 'tripartite' => 0,
  452. 'type_shop' => 0,
  453. 'mer_id' => 0,
  454. 'source' => 0,
  455. 'order_type' => 1,
  456. 'is_red_brokerage' => 0,
  457. 'gzc' => 3,
  458. 'take_time' => time(),
  459. 'district_id' => '',
  460. 'street_id' => '',
  461. 'month' => '',
  462. ];
  463. $a = Db::name('user_bill')->insert($bill);
  464. $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
  465. }
  466. }
  467. public function share_prosperity_test_partner()
  468. {
  469. $groupUser = Db::name('shared_prosperity_user')->where('partner_level',3)->select()->toArray();
  470. $userData = array_column($groupUser,'user_id');
  471. $money = 34.27;
  472. foreach ($userData as $key => $uid) {
  473. $bill = [
  474. 'uid' => $uid,
  475. 'link_id' => 0,
  476. 'pm' => 1,
  477. 'title' => '共富钻石合伙人分红',
  478. 'category' => 'now_money',
  479. 'type' => 'commission',
  480. 'number' => $money,
  481. 'balance' => 0,
  482. 'mark' => '共富钻石合伙人分红',
  483. 'create_time' => date('Y-m-d H:i:s'),
  484. 'status' => 1,
  485. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
  486. 'order_sn' => 0,
  487. 'tripartite' => 0,
  488. 'type_shop' => 0,
  489. 'mer_id' => 0,
  490. 'source' => 0,
  491. 'order_type' => 1,
  492. 'is_red_brokerage' => 0,
  493. 'gzc' => 3,
  494. 'take_time' => time(),
  495. 'district_id' => '',
  496. 'street_id' => '',
  497. 'month' => '',
  498. ];
  499. $a = Db::name('user_bill')->insert($bill);
  500. $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
  501. }
  502. }
  503. }