Task.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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. // 2026-3-9总裁分红
  401. // 刘银霞480元
  402. // 李素红560元
  403. // 徐丽萍128元
  404. // 李玉芝268元
  405. // 其他5个总裁每个人58元
  406. // $userData = [
  407. // 43 => 128,
  408. // 62 => 560,
  409. // 192 => 480,
  410. // 3 => 58,
  411. // 2393 => 268,
  412. // 4001 => 58,
  413. // 4073 => 58,
  414. // 2540 => 58,
  415. // 4899 => 58,
  416. // ];
  417. // 2026-3-16总裁分红
  418. // 刘银霞490元
  419. // 李素红580元
  420. // 徐丽萍158元
  421. // 李玉芝296元
  422. // 其他5个总裁每个人68元
  423. // $userData = [
  424. // 192 => 490,
  425. // 62 => 580,
  426. // 43 => 158,
  427. // 2393 => 296,
  428. // 3 => 68,
  429. // 4001 => 68,
  430. // 4073 => 68,
  431. // 2540 => 68,
  432. // 4899 => 68,
  433. // ];
  434. // 2026-3-23总裁分红
  435. // 刘银霞880元,
  436. // 李素红490元,
  437. // 徐丽萍168元,
  438. // 李玉芝 268元,
  439. // 其他5人,每人68元
  440. $userData = [
  441. 192 => 880,
  442. 62 => 490,
  443. 43 => 168,
  444. 2393 => 268,
  445. 3 => 68,
  446. 4001 => 68,
  447. 4073 => 68,
  448. 2540 => 68,
  449. 4899 => 68,
  450. ];
  451. foreach ($userData as $uid => $money) {
  452. $bill = [
  453. 'uid' => $uid,
  454. 'link_id' => 0,
  455. 'pm' => 1,
  456. 'title' => '共富总裁合伙人分红',
  457. 'category' => 'now_money',
  458. 'type' => 'commission',
  459. 'number' => $money,
  460. 'balance' => 0,
  461. 'mark' => '共富总裁合伙人分红',
  462. 'create_time' => date('Y-m-d H:i:s'),
  463. 'status' => 1,
  464. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
  465. 'order_sn' => 0,
  466. 'tripartite' => 0,
  467. 'type_shop' => 0,
  468. 'mer_id' => 0,
  469. 'source' => 0,
  470. 'order_type' => 1,
  471. 'is_red_brokerage' => 0,
  472. 'gzc' => 3,
  473. 'take_time' => time(),
  474. 'district_id' => '',
  475. 'street_id' => '',
  476. 'month' => '',
  477. ];
  478. $a = Db::name('user_bill')->insert($bill);
  479. $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
  480. }
  481. }
  482. public function share_prosperity_test_group()
  483. {
  484. $groupId = 1;
  485. $desc = [
  486. 1 => '共富万人团分红',
  487. 2 => '共富千人团分红'
  488. ];
  489. $money = [
  490. 1 => 2.41,
  491. 2 => 23.37
  492. ];
  493. $groupUser = Db::name('shared_prosperity_group_user')->where('group_id', $groupId)->where('status',1)->select()->toArray();
  494. $userData = array_column($groupUser, 'user_id');
  495. foreach ($userData as $key => $uid) {
  496. $bill = [
  497. 'uid' => $uid,
  498. 'link_id' => 0,
  499. 'pm' => 1,
  500. 'title' => $desc[$groupId],
  501. 'category' => 'now_money',
  502. 'type' => 'commission',
  503. 'number' => $money[$groupId],
  504. 'balance' => 0,
  505. 'mark' => $desc[$groupId],
  506. 'create_time' => date('Y-m-d H:i:s'),
  507. 'status' => 1,
  508. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_GROUP_COMMISSION']['code'],
  509. 'order_sn' => 0,
  510. 'tripartite' => 0,
  511. 'type_shop' => 0,
  512. 'mer_id' => 0,
  513. 'source' => 0,
  514. 'order_type' => 1,
  515. 'is_red_brokerage' => 0,
  516. 'gzc' => 3,
  517. 'take_time' => time(),
  518. 'district_id' => '',
  519. 'street_id' => '',
  520. 'month' => '',
  521. ];
  522. $a = Db::name('user_bill')->insert($bill);
  523. $b = Db::name('user')->where('uid', $uid)->inc('brokerage_price', $money[$groupId])->update();
  524. }
  525. }
  526. public function share_prosperity_test_partner()
  527. {
  528. $level = 1;
  529. $desc = [
  530. 1 => '共富一星合伙人分红',
  531. 2 => '共富二星合伙人分红',
  532. 3 => '共富三星合伙人分红',
  533. 4 => '共富钻石合伙人分红',
  534. ];
  535. $money = [
  536. 1 => 5.05,
  537. 2 => 11.81,
  538. 3 => 24.93,
  539. 4 => 29.92,
  540. ];
  541. $groupUser = Db::name('shared_prosperity_user')->where('partner_level', $level)->select()->toArray();
  542. $userData = array_column($groupUser, 'user_id');
  543. foreach ($userData as $key => $uid) {
  544. $bill = [
  545. 'uid' => $uid,
  546. 'link_id' => 0,
  547. 'pm' => 1,
  548. 'title' => $desc[$level],
  549. 'category' => 'now_money',
  550. 'type' => 'commission',
  551. 'number' => $money[$level],
  552. 'balance' => 0,
  553. 'mark' => $desc[$level],
  554. 'create_time' => date('Y-m-d H:i:s'),
  555. 'status' => 1,
  556. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
  557. 'order_sn' => 0,
  558. 'tripartite' => 0,
  559. 'type_shop' => 0,
  560. 'mer_id' => 0,
  561. 'source' => 0,
  562. 'order_type' => 1,
  563. 'is_red_brokerage' => 0,
  564. 'gzc' => 3,
  565. 'take_time' => time(),
  566. 'district_id' => '',
  567. 'street_id' => '',
  568. 'month' => '',
  569. ];
  570. $a = Db::name('user_bill')->insert($bill);
  571. $b = Db::name('user')->where('uid', $uid)->inc('brokerage_price', $money[$level])->update();
  572. }
  573. }
  574. public function system_subsidy()
  575. {
  576. $title = '系统补贴';
  577. $map = [
  578. 186 => 680
  579. ];
  580. foreach ($map as $uid => $money) {
  581. $bill = [
  582. 'uid' => $uid,
  583. 'link_id' => 0,
  584. 'pm' => 1,
  585. 'title' => $title,
  586. 'category' => 'now_money',
  587. 'type' => 'commission',
  588. 'number' => $money,
  589. 'balance' => 0,
  590. 'mark' => $title,
  591. 'create_time' => date('Y-m-d H:i:s'),
  592. 'status' => 1,
  593. 'commission_type' => CommonEnum::COMMISSION_TYPE['SYSTEM_SUBSIDY_COMMISSION']['code'],
  594. 'order_sn' => 0,
  595. 'tripartite' => 0,
  596. 'type_shop' => 0,
  597. 'mer_id' => 0,
  598. 'source' => 0,
  599. 'order_type' => 1,
  600. 'is_red_brokerage' => 0,
  601. 'gzc' => 3,
  602. 'take_time' => time(),
  603. 'district_id' => '',
  604. 'street_id' => '',
  605. 'month' => '',
  606. ];
  607. $a = Db::name('user_bill')->insert($bill);
  608. $b = Db::name('user')->where('uid', $uid)->inc('brokerage_price', $money)->update();
  609. }
  610. }
  611. }