798 Commits

Author SHA1 Message Date
lccsw c27fce37ca 东风EX 2022-05-16 09:44:57 +08:00
lccsw 5e38e25b1c add-plan-zx_to_test 2022-05-14 10:12:51 +08:00
lccsw 6d93e5649a add-admin-refund_time 2022-05-13 16:52:01 +08:00
lccsw 1edb72f717 edit-admin-order_list 2022-05-13 14:26:29 +08:00
lccsw 46cd207197 edit-admin-order_list 2022-05-12 16:33:36 +08:00
lccsw d9582123b2 edit-liche-pay_robot 2022-05-12 14:35:56 +08:00
lccsw c14c6dd845 edit-order-send_sms2 2022-05-12 12:00:08 +08:00
lccsw 638566d7ae edit-order-send_sms 2022-05-12 11:59:07 +08:00
lccsw 0fac734e33 edit-admin-finish_order 2022-05-12 11:32:18 +08:00
lccsw 5ab380cda6 add-licheb-log 2022-05-11 16:41:08 +08:00
dengbw 0c634cbfcb material_510_3 2022-05-10 17:25:42 +08:00
dengbw 470b32c529 material_510_2 2022-05-10 17:02:08 +08:00
dengbw 8db8ea688f material_510 2022-05-10 15:56:18 +08:00
dengbw 77d287b592 customer_510_2 2022-05-10 11:41:50 +08:00
lccsw d4562109b6 edit-common-update_order_time2 2022-05-10 11:37:39 +08:00
dengbw a45e4b7af0 customer_510 2022-05-10 11:35:55 +08:00
lccsw be8e28a1bf edit-common-update_order_time 2022-05-09 22:12:56 +08:00
lccsw 3a1778eed3 edit-qywx-rebot 2022-05-09 22:05:55 +08:00
dengbw 37f4d30b95 live_509 2022-05-09 16:32:45 +08:00
lccsw c6f2db4b95 edit-admin-order_list 2022-05-09 14:31:01 +08:00
lccsw fada3ad596 add-admin-inten 2022-05-09 14:13:28 +08:00
dengbw 07a40f1aa0 live_507_2 2022-05-07 17:11:16 +08:00
lccsw e306f0d522 edit-api-licheb-cancel_order 2022-05-07 16:07:15 +08:00
dengbw 3c186cb310 live_507 2022-05-07 15:16:07 +08:00
lccsw 3c88d34dbb edit-admin-over_time 2022-05-06 14:29:21 +08:00
lccsw 8d57ac214c add-licheb-over_time 2022-05-06 13:54:08 +08:00
dengbw 687fa60438 live_506 2022-05-06 11:22:20 +08:00
lccsw c58653a103 edit-admin-cancel_item 2022-05-05 16:34:38 +08:00
dengbw 17f6e032d8 clues_505 2022-05-05 14:09:20 +08:00
lccsw 99e36991b8 edit-plan-settle 2022-05-05 14:06:14 +08:00
lccsw 3de7c4e1dd edit-api-biz-mchid 2022-05-05 11:52:45 +08:00
lccsw b41b3e1f52 del-licheb-unmber_format 2022-05-05 11:49:52 +08:00
dengbw 190074d0e3 customers_430 2022-05-05 11:49:12 +08:00
dengbw 4830f8f7b0 customers_429_3 2022-04-29 14:56:19 +08:00
dengbw eeb940be5b customers_429_2 2022-04-29 11:31:43 +08:00
dengbw 7034132702 customers_429 2022-04-29 11:00:22 +08:00
dengbw d47fddafd2 subject_429 2022-04-29 09:38:02 +08:00
lccsw 49c6fc2e05 add-licheb-orc_car_img 2022-04-29 09:19:32 +08:00
dengbw 0a15200b72 transfer_428 2022-04-28 16:11:26 +08:00
dengbw a011da60a7 licheb_428_4 2022-04-28 11:50:45 +08:00
dengbw 7e4a33ffd1 licheb_428_3 2022-04-28 11:17:01 +08:00
dengbw 037b7ad3e0 licheb_428_2 2022-04-28 10:56:43 +08:00
lccsw 566d3a6c4d edit-api-money_limit 2022-04-28 10:42:15 +08:00
dengbw f8fe22afee licheb_428 2022-04-28 10:29:11 +08:00
lccsw 5442f94a69 edit-admin-pay_log 2022-04-27 17:46:25 +08:00
lccsw 23a9e90bcc edit-api-pay_up_customer 2022-04-27 17:30:11 +08:00
lccsw 4e904e06d2 edit-admin-order_filter 2022-04-26 11:33:23 +08:00
dengbw e6b1e96c6c userslog_426 2022-04-26 09:59:40 +08:00
lccsw aaf43c9bdf edit-api-money_limit 2022-04-25 10:10:52 +08:00
dengbw c985c16e71 userslog_424_2 2022-04-24 16:02:13 +08:00
dengbw 1214feb016 userslog_424 2022-04-24 15:44:14 +08:00
lccsw 5e04a5319b edit-admin-order_list 2022-04-24 14:47:04 +08:00
dengbw 0e11a46cd1 userslog_422_2 2022-04-22 17:39:53 +08:00
lccsw 83a6f8ee13 add-tcorc-veh 2022-04-22 15:53:32 +08:00
dengbw 9efbf11459 userslog_422 2022-04-22 14:09:07 +08:00
lccsw bb0b41807f edit-api-licheb-user 2022-04-22 11:20:37 +08:00
lccsw f4aa0fcd75 add-api-pdf_sa 2022-04-22 11:04:00 +08:00
dengbw bf42ad618a customer_421 2022-04-21 15:28:42 +08:00
lccsw 09a6fb183a edit-common-get_company 2022-04-21 14:35:23 +08:00
dengbw 986d221303 orders_421 2022-04-21 11:35:31 +08:00
lccsw e6a531206a edit-licheb-order_loan 2022-04-21 10:46:33 +08:00
lccsw 7eecfb5e5b edit-api-customer 2022-04-21 10:10:06 +08:00
lccsw f74b181859 edit-admin-business_lists 2022-04-20 11:35:44 +08:00
dengbw 0bd4260d1b transfer_420 2022-04-20 11:19:04 +08:00
lccsw fc92086607 edit-api-customer_detail 2022-04-19 17:32:50 +08:00
lccsw ea22a78a2a edit-api-cus_detail 2022-04-19 16:01:10 +08:00
lccsw 9fd9770b3c add-plan-out_time_order 2022-04-19 15:44:18 +08:00
dengbw 1b4f36623f transfer_419_3 2022-04-19 15:39:29 +08:00
dengbw c02ddb603b transfer_419 2022-04-19 13:48:21 +08:00
dengbw ce91711da8 userslog_419 2022-04-19 10:45:44 +08:00
lccsw 026f10911a edit-admin-order_list 2022-04-18 17:38:01 +08:00
dengbw d0f34871d6 userslog_418_3 2022-04-18 16:51:26 +08:00
dengbw 456b0fc35c userslog_418_2 2022-04-18 15:05:39 +08:00
lccsw edbc8086fe add-api-order_uname 2022-04-18 14:18:32 +08:00
dengbw c2a4dd1bdd userslog_418 2022-04-18 13:51:56 +08:00
lccsw ee13b9084f edit-admin-order_list 2022-04-18 11:17:59 +08:00
dengbw 4457c9db21 customer_417 2022-04-17 10:42:29 +08:00
dengbw 0792bb4c35 customer_416 2022-04-16 09:37:14 +08:00
dengbw 88efd15fdc customer_415_4 2022-04-15 17:11:30 +08:00
dengbw 7aab9d981c customer_415_3 2022-04-15 16:43:52 +08:00
dengbw 48436bae74 customer_415_2 2022-04-15 16:38:16 +08:00
lccsw 5a6ca3f952 edit-api-order_list 2022-04-15 16:29:52 +08:00
dengbw 3bae7fc767 customer_415 2022-04-15 14:57:59 +08:00
lccsw f55ed17711 edit-plan-biz_settle 2022-04-14 17:35:33 +08:00
lccsw c1a211fc74 add-comomn-CarInvoiceOCR 2022-04-14 17:18:36 +08:00
dengbw 4db90d0a27 customer_414 2022-04-14 14:09:15 +08:00
lccsw 3d274a8cff edit-admin-filter_order 2022-04-13 16:19:47 +08:00
lccsw 37826a9b86 edit-api-order_list 2022-04-13 16:07:09 +08:00
lccsw 69ed1360d7 edit-admin-order_detail 2022-04-13 14:52:50 +08:00
lccsw 3cef15bd00 edit-admin-order 2022-04-13 14:02:26 +08:00
lccsw 485baac16f edit-biz-settle 2022-04-12 11:34:46 +08:00
dengbw fc9f067098 customer_412 2022-04-12 10:30:44 +08:00
dengbw af2e612574 customer_411_2 2022-04-11 14:11:21 +08:00
dengbw 5c2e8f9975 customer_411 2022-04-11 13:53:28 +08:00
lccsw 1e5797d962 edit-common-get_wxmch_id 2022-04-11 09:41:27 +08:00
lccsw 9d6c589556 edit-api-pay 2022-04-08 18:00:46 +08:00
lccsw 519bc9671a edit-api-edit_orderv2 2022-04-08 16:20:23 +08:00
dengbw 52d7c341c8 admin_408 2022-04-08 15:36:44 +08:00
lccsw 2f82a576d4 edit-api-order_list 2022-04-08 13:35:53 +08:00
lccsw 3a55ac506e edit-api-add_order_limit2 2022-04-07 17:49:46 +08:00
lccsw 4b020e9c88 edit-api-add_order_limit 2022-04-07 17:36:28 +08:00
lccsw 14a9e6db5e edit-licheb-add_order 2022-04-07 17:02:30 +08:00
lccsw 412e2d9e95 edit-liche-deal 2022-04-07 16:30:01 +08:00
dengbw 8d4a654e9a tag_407_2 2022-04-07 14:10:43 +08:00
dengbw 898a8b7324 tag_407 2022-04-07 14:06:47 +08:00
lccsw 46e4d5513b edit-api-create_order 2022-04-06 17:49:25 +08:00
dengbw 9d9c9c27d8 tag_406 2022-04-06 17:48:53 +08:00
lccsw 29e7520c89 edit-api-old_create_order 2022-04-06 17:38:24 +08:00
lccsw 520542cbbf edit-admin-settle 2022-04-06 17:34:13 +08:00
lccsw 8f1338e2eb edit-api-old_create_order 2022-04-05 16:55:07 +08:00
dengbw bb8bf1064f inventory_403 2022-04-03 15:34:36 +08:00
lccsw 41c1387ee8 edit-admin-edit_biz 2022-04-03 09:44:59 +08:00
lccsw 8247a73d43 edit-admin-order_status 2022-04-02 21:32:52 +08:00
dengbw f690fb1b7b stock_402 2022-04-02 15:25:20 +08:00
lccsw 7c5cbf02a9 edit-common-biz_mch_id 2022-04-02 14:55:01 +08:00
lccsw 56d0cdc213 edit-api-edit_order 2022-04-02 09:29:46 +08:00
lccsw 7bf6b25d38 edit-common-add_pay_order 2022-04-01 17:22:40 +08:00
lccsw 6748e392f0 add-api-pay_img 2022-04-01 16:35:14 +08:00
lccsw 01c68e4955 edit-api-pay_img 2022-04-01 12:25:17 +08:00
lccsw c6c4e54296 edit-api-biz_company 2022-04-01 11:22:41 +08:00
lccsw 76eee8bce7 edit-api-biz_company 2022-04-01 10:36:21 +08:00
lccsw aed4c8beb8 edit-api-business 2022-04-01 10:03:18 +08:00
lccsw be66e2c68d edit-admin-order_list_filter 2022-03-31 14:05:02 +08:00
dengbw e39a810888 stock_331 2022-03-31 11:40:48 +08:00
lccsw abae1d02ec edit-admin-order_list 2022-03-31 11:30:42 +08:00
lccsw a131e4c819 edit-api-liche_pay_desc 2022-03-30 13:57:37 +08:00
dengbw 49bfce1c33 persona_320_2 2022-03-30 11:54:48 +08:00
dengbw 12a574ab74 persona_320
persona_320_2
2022-03-30 10:34:10 +08:00
lccsw f05266035b add-plan-up_order 2022-03-29 17:15:59 +08:00
lccsw 49f52141b3 edit-liche-pay_status 2022-03-29 15:36:59 +08:00
dengbw c981eaef98 lichene_329 2022-03-29 09:24:11 +08:00
lccsw db97fc7417 edit-admin-order_filter 2022-03-28 17:34:18 +08:00
lccsw e774a9873c edit-admin-show_order 2022-03-28 17:27:47 +08:00
dengbw 049f5ad51f lichene_328_6 2022-03-28 16:49:57 +08:00
dengbw a544a1f8d5 lichene_328_5 2022-03-28 14:40:50 +08:00
dengbw e8efee9ddc lichene_328_4 2022-03-28 14:27:08 +08:00
dengbw 9298a1f05b lichene_328_3 2022-03-28 14:05:28 +08:00
dengbw 32edb7e039 lichene_328_2 2022-03-28 14:01:11 +08:00
dengbw 791ccf705a lichene_328 2022-03-28 13:57:18 +08:00
dengbw 8847490cf7 lichene_325 2022-03-28 13:41:36 +08:00
lccsw efa4154a13 edit-common-intention 2022-03-27 14:35:05 +08:00
lccsw a26d801b49 edit-admin-business' 2022-03-26 01:07:38 +08:00
lccsw cc27ea79fe edit-admin-robot 2022-03-26 00:48:01 +08:00
lccsw 56b96fa3c7 edit-common-company 2022-03-25 23:48:23 +08:00
dengbw 8bde09f8e9 lichene_325 2022-03-25 22:43:47 +08:00
lccsw d93e8fb97f edit-common-qyrobot-2 2022-03-25 22:14:22 +08:00
lccsw 31da2399e3 edit-common-qyrobot 2022-03-25 22:10:07 +08:00
lccsw d39502b9c6 edit-admin-up_img 2022-03-25 18:04:53 +08:00
lccsw a1621b5e19 edit-admin-order_list 2022-03-25 16:46:34 +08:00
lccsw 047888fffa edit-admin-export-order 2022-03-25 16:38:41 +08:00
lccsw 57291aab87 edit-api-add_clues 2022-03-25 16:11:09 +08:00
lccsw e01232075e eidt-api-licheb-up_img 2022-03-25 15:09:07 +08:00
lccsw 632011b659 edit-api-liche_update_order 2022-03-25 14:37:24 +08:00
lccsw ddd5545f4e edit-admin-order_list 2022-03-25 09:53:10 +08:00
lccsw 3a753e03ec edit-admin-business_page 2022-03-25 09:42:01 +08:00
lccsw 88debfefb1 edit-commit-robot 2022-03-25 09:28:51 +08:00
lccsw 669890eab5 edit-order-opt 2022-03-24 22:29:48 +08:00
lccsw 20c3bf1f52 edit-api-post_clues 2022-03-24 15:40:17 +08:00
dengbw fce00ca3f6 introduce_324 2022-03-24 09:21:28 +08:00
dengbw 37b847104b introduce_323 2022-03-23 15:45:27 +08:00
dengbw 735c2b8425 introduce_322_2 2022-03-23 11:06:00 +08:00
dengbw 4a8ab12a45 introduce_322_2 2022-03-22 17:49:59 +08:00
dengbw f26475794f introduce_322 2022-03-22 17:19:46 +08:00
dengbw c62e78a8cc customer_318 2022-03-18 17:51:18 +08:00
xiaoyu 51df618d0d fixed 2022-03-17 21:43:55 +08:00
dengbw ec1827d2ba customer_317 2022-03-17 16:52:45 +08:00
lccsw 60943bd1c7 add-admin-export-admin_name 2022-03-17 10:49:47 +08:00
dengbw 661e08b403 customer_tag_316_2 2022-03-16 10:55:23 +08:00
dengbw 8f19789a04 customer_tag_316 2022-03-16 10:22:25 +08:00
dengbw c617a99ffb customer_tag_315_3 2022-03-15 17:52:16 +08:00
lccsw 564c45d8d5 edit-common-pdf_url 2022-03-15 15:00:02 +08:00
dengbw d32fec4152 customer_tag_315_2 2022-03-15 13:34:45 +08:00
dengbw 18a0d23ee9 customer_tag_315 2022-03-15 11:37:42 +08:00
lccsw 1f2c6be884 edit-pdf-url2 2022-03-15 09:43:56 +08:00
lccsw caa508c362 edit-pdf-url 2022-03-15 09:21:09 +08:00
dengbw 4e6211f075 admin_customer_tag_311 2022-03-11 17:06:31 +08:00
lccsw f97220945d edit-admin-export_order 2022-03-10 16:13:54 +08:00
lccsw 240641cc4a edit-api-g_time 2022-03-10 15:17:19 +08:00
dengbw 6de7b9e143 admin_transfer_310_3 2022-03-10 14:45:28 +08:00
dengbw d1f740e989 admin_transfer_310_2 2022-03-10 13:36:57 +08:00
dengbw fb5948708b admin_transfer_310 2022-03-10 10:15:45 +08:00
dengbw 82a9cf1c75 admin_transfer_309 2022-03-09 17:57:50 +08:00
dengbw 68073b4552 admin_transfer_308_4 2022-03-08 17:07:21 +08:00
dengbw 93dd37df2d admin_transfer_308_3 2022-03-08 11:41:35 +08:00
dengbw 502306b10a admin_transfer_308_2 2022-03-08 11:27:29 +08:00
dengbw 8a77a15270 admin_transfer_308 2022-03-08 11:15:49 +08:00
dengbw 02f8667f02 admin_transfer_304 2022-03-04 11:41:20 +08:00
dengbw f417b0818a admin_items_303 2022-03-03 17:39:20 +08:00
dengbw af903d1e64 inventory_303 2022-03-03 10:38:50 +08:00
dengbw 44c3fda88e inventory_302_2 2022-03-02 17:55:14 +08:00
dengbw 74026eed93 Merge branch 'fea#dbw_inventory' into dev 2022-03-02 17:37:57 +08:00
dengbw 26add2743a inventory_302 2022-03-02 17:36:23 +08:00
lccsw 8b09d1ba58 edit-pdftoimg-api_url 2022-02-27 20:55:44 +08:00
dengbw db4cd9018a api_transfer_224 2022-02-24 16:14:57 +08:00
dengbw 7a028b8683 admin_transfer_221 2022-02-21 14:48:41 +08:00
dengbw fb314c4e97 admin_polyv_218 2022-02-18 10:29:50 +08:00
dengbw e6e7867415 admin_polyv_217 2022-02-17 11:16:21 +08:00
lccsw 3c263af484 edit-api-series_car 2022-02-16 15:16:47 +08:00
lccsw ae1c9bff68 edit-api-price_book 2022-02-14 11:57:47 +08:00
dengbw 66dc89bd4c transfer_210 2022-02-10 14:20:15 +08:00
dengbw 3b1695262c syt_210 2022-02-10 11:18:45 +08:00
dengbw 4337f7d72a syt_209 2022-02-09 16:35:47 +08:00
dengbw 97637e5306 transfer_209 2022-02-09 15:30:46 +08:00
lccsw 645def3aff add-admin-biz_company_type 2022-02-09 10:16:17 +08:00
dengbw 149d17637a syt_128_2 2022-01-28 17:13:25 +08:00
dengbw 150f5e608a Merge branch 'fea#dbw_syt2022' into dev 2022-01-28 16:17:53 +08:00
dengbw e0fb4f5a41 syt_128 2022-01-28 16:16:36 +08:00
dengbw badb3720d0 admin_tranfer_127_2 2022-01-27 16:30:53 +08:00
dengbw 0194c1a5bd admin_tranfer_127 2022-01-27 16:17:33 +08:00
dengbw acd4365e2d admin_tranfer_126 2022-01-26 10:33:28 +08:00
xiaoyu 10e92a7668 material 2022-01-24 22:06:16 +08:00
dengbw 1c1df4a5ec home_tranfer_120_3 2022-01-20 17:02:38 +08:00
dengbw 11618a1a36 home_tranfer_120_2 2022-01-20 15:40:34 +08:00
dengbw 826f79a8d9 home_tranfer_120 2022-01-20 09:51:41 +08:00
lccsw 96081eb6b4 edit-api-give_time 2022-01-19 20:00:13 +08:00
dengbw ef1018b32d api_material_119 2022-01-19 11:30:35 +08:00
dengbw 191828a6e6 admin_transfer_118_2 2022-01-18 14:21:49 +08:00
dengbw 14d81648ea admin_transfer_118 2022-01-18 11:26:56 +08:00
lccsw 7ac34dcd57 edit-admin-clues 2022-01-12 10:12:15 +08:00
dengbw 46661cf1bc stituation_110_3 2022-01-10 17:28:20 +08:00
dengbw 1ed9d8ab64 stituation_110_2 2022-01-10 17:22:31 +08:00
dengbw 7622667be7 stituation_1010 2022-01-10 11:17:24 +08:00
lccsw 25ada26f3c edit-liche-roboot 2022-01-07 16:58:46 +08:00
lccsw 95cace10f2 add-api-fill_pdf 2022-01-06 16:03:07 +08:00
lccsw c2b3165473 edit-api-edit-customer 2022-01-06 10:53:38 +08:00
lccsw 3703cf37eb add-vendor-pdftk 2022-01-05 15:56:46 +08:00
lccsw 9566815d4e edit-liche-resign 2022-01-05 15:47:05 +08:00
lccsw 329d145705 add-api-test 2022-01-05 15:43:49 +08:00
lccsw ff9ab23389 edit-liche-resign 2022-01-05 15:07:43 +08:00
dengbw c308f45de7 transfer_105 2022-01-05 10:14:42 +08:00
lccsw a8994824e1 edit-licheb-up_idcard 2022-01-05 09:59:27 +08:00
dengbw a07d58cdd5 transfer_104 2022-01-04 16:18:53 +08:00
dengbw ee8e8e1830 transfer_1231_3 2021-12-31 10:30:04 +08:00
dengbw 94437cd8fc transfer_1231_2 2021-12-31 10:00:19 +08:00
dengbw 26f5191ff5 transfer_1231 2021-12-31 09:40:34 +08:00
dengbw dcb96880d8 transfer_1230_6 2021-12-30 17:36:57 +08:00
lccsw f8a3ee2089 edit-admin-order_item 2021-12-30 17:36:40 +08:00
dengbw 95d49bd88c transfer_1230_5 2021-12-30 17:30:08 +08:00
dengbw 3ee20350eb transfer_1230_4 2021-12-30 14:44:25 +08:00
dengbw dc5caa1fc1 transfer_1230_2
transfer_1230_3
2021-12-30 10:43:40 +08:00
dengbw 0e60e77953 transfer_1230 2021-12-30 10:31:14 +08:00
dengbw 7c53fea02c transfer_1229 2021-12-29 17:13:02 +08:00
dengbw ac2bb5131b transfer_1228_2 2021-12-28 16:37:28 +08:00
dengbw b11c6a5f61 transfer_1228 2021-12-28 16:01:09 +08:00
dengbw 7d192cce94 transfer_1228 2021-12-28 15:50:15 +08:00
lccsw da2249aeb3 edit-api-progress 2021-12-28 15:29:44 +08:00
lccsw ff26be0f83 edit-liche-api 2021-12-28 15:20:53 +08:00
lccsw 6ef78ac2d8 add-admin_item_list_company 2021-12-27 14:45:54 +08:00
lccsw 19ab5a955f edit-api-brokerage_limit 2021-12-27 11:40:04 +08:00
lccsw ce92dda835 edit-admin-order_loan 2021-12-25 09:45:23 +08:00
lccsw 92ef319347 edit-admin-order_detail 2021-12-24 17:09:19 +08:00
lccsw 8bec4c7adc edit-admin-item_check 2021-12-24 17:02:38 +08:00
lccsw 0670282c73 add-admin-item_company_id 2021-12-24 16:49:11 +08:00
lccsw 1954668475 add-licheb-brokerage 2021-12-24 16:24:36 +08:00
lccsw 8952ef31a6 edit-api-brand=5 2021-12-24 15:13:12 +08:00
lccsw 417b3cebb1 edit-api-edit_orde 2021-12-23 11:02:14 +08:00
lccsw 7a82a12054 edit-admin-distribution_html 2021-12-22 16:58:37 +08:00
lccsw 110ff8c715 edit-admin-get_commission 2021-12-22 16:33:40 +08:00
lccsw 7680ba8948 edit-admin-distribution 2021-12-22 14:01:30 +08:00
lccsw 12719a8faa edit-home-tool 2021-12-21 17:15:56 +08:00
lccsw 57ce4e125a edit-api-cancel_fine 2021-12-21 13:45:39 +08:00
lccsw 84d5d8c754 edit-admin-order_detail 2021-12-21 10:29:07 +08:00
lccsw 09ea7e53ed edit-api-pay_order 2021-12-20 15:52:06 +08:00
lccsw 30ebc651f7 edit-api-deal_log 2021-12-17 16:47:36 +08:00
lccsw 5bdff46342 edit-admin-order_agent_list 2021-12-17 16:32:32 +08:00
lccsw b3802bddff edit-admin-order_agent_list 2021-12-17 16:25:13 +08:00
lccsw 26e5059336 edit-order_entity 2021-12-17 15:31:13 +08:00
lccsw 2aa997f2bf edit-plan-create_paylog 2021-12-17 15:26:24 +08:00
lccsw f5b4c6c14a edit-api-order_process 2021-12-17 15:18:14 +08:00
lccsw b08fa24b1d edit-api-text 2021-12-17 15:09:28 +08:00
dengbw 2693f69c0a transfer_1216_2 2021-12-16 17:08:59 +08:00
dengbw 150d570f3b Merge branch 'fea#dbw_transfer' into dev 2021-12-16 17:00:22 +08:00
dengbw ac318e108b transfer_1216 2021-12-16 16:58:51 +08:00
lccsw 2ac6955b0f edit-admin-customer-list 2021-12-16 14:25:35 +08:00
lccsw 5b2b9697f5 edit-add_pay_log 2021-12-16 09:34:18 +08:00
lccsw 1d2279a019 edit-admin-add_pay_log2 2021-12-15 17:32:00 +08:00
lccsw 6acc27dcbc edit-admin-add_pay_log 2021-12-15 17:00:07 +08:00
lccsw 8215d4b02f edit-api-pay_list1 2021-12-14 15:02:17 +08:00
lccsw 8f066612f7 edit-api-pay_list 2021-12-14 13:52:40 +08:00
lccsw 623f7b7cd8 edit-admin-order_filter 2021-12-13 17:05:40 +08:00
lccsw 75c901c635 edit-api-create_order_limit 2021-12-13 16:15:33 +08:00
dengbw 9881eef464 api_bobing_1209 2021-12-09 17:08:41 +08:00
lccsw c58bacf10f edit-api-finish_order 2021-12-08 17:42:05 +08:00
lccsw e783cb0c01 edit-admin-add_pay_log 2021-12-08 16:35:17 +08:00
dengbw 8aea70857d admin_channel_1208 2021-12-08 14:44:34 +08:00
lccsw e795d6fe4e add-admin-complete_order 2021-12-08 09:59:03 +08:00
lccsw 8cce0b93e7 edit-admin-order_list2 2021-12-07 15:18:51 +08:00
lccsw 6d7fdbb2f5 edit-admin-order_list 2021-12-07 15:05:24 +08:00
lccsw 163632f723 edit-api-auth_mobile 2021-12-07 14:14:05 +08:00
lccsw edc1ad2068 edit-api-create_order 2021-12-06 21:17:28 +08:00
lccsw f3ce692435 edit-liche-create_pay_order 2021-12-06 17:10:32 +08:00
lccsw 4248b7e931 edit-cancel-select_car2 2021-12-06 16:19:56 +08:00
lccsw dfbc9a7ac7 edit-cancel-select_car 2021-12-06 14:51:20 +08:00
dengbw 21c5a7dd52 admin_licheb_1206 2021-12-06 10:57:56 +08:00
dengbw c7faf370e2 admin_material_1203 2021-12-03 17:48:19 +08:00
dengbw c065fab653 admin_goods_1203_2 2021-12-03 15:26:43 +08:00
dengbw 60536a0073 admin_goods_1203 2021-12-03 15:19:04 +08:00
lccsw 99ca652744 edit-admin-order_list 2021-12-03 14:18:07 +08:00
lccsw 81fa5fb966 edit-api-text 2021-12-03 11:02:20 +08:00
lccsw dc8164fb75 edit-api-edit_order 2021-12-03 10:55:36 +08:00
lccsw 908b561b3f edit-api-delete_old_orders 2021-12-03 10:41:32 +08:00
dengbw 7a962897e7 admin_orders_1203 2021-12-03 09:46:23 +08:00
lccsw e35e25eab2 edit-api-pay_limit 2021-12-02 17:36:24 +08:00
dengbw fc08caa600 luckybag_1202_5 2021-12-02 16:38:02 +08:00
dengbw 194ea4c516 luckybag_1202_4 2021-12-02 16:28:22 +08:00
dengbw 052f8b94ec luckybag_1202_3 2021-12-02 16:17:56 +08:00
dengbw fc2dda94ae luckybag_1202_2 2021-12-02 15:38:56 +08:00
lccsw 31a139f9cb add-tool-pdf_type 2021-12-02 15:00:00 +08:00
dengbw 9e9d887061 luckybag_1202 2021-12-02 13:46:43 +08:00
lccsw 9b7b63322d edit-api-hidden-video 2021-12-02 11:47:16 +08:00
lccsw f96e24bd3e add-api-bak_mobile cancel_car 2021-12-01 17:29:45 +08:00
lccsw d1ab6c72fa edit-api-edit_order 2021-11-30 17:02:21 +08:00
lccsw 4e31718409 add-api-BizLicense 2021-11-30 15:56:34 +08:00
lccsw 9ac7171b19 delete-test-code 2021-11-30 11:45:52 +08:00
lccsw 1e45295371 edit-liche-static 2021-11-28 16:37:41 +08:00
lccsw 0d7f1e3708 edit-api-create_order 2021-11-28 16:12:32 +08:00
lccsw 18eb8634b0 edit-common-auto_config 2021-11-26 14:16:14 +08:00
dengbw 5f71b531ef admin_orders_1126 2021-11-26 11:45:29 +08:00
lccsw 7febbcd69d edit-upda-order_time 2021-11-26 11:34:19 +08:00
lccsw a41b8ff77f edit-api-create_order 2021-11-26 11:18:39 +08:00
lccsw 323b808135 edit-api-constract 2021-11-26 10:56:26 +08:00
dengbw d4928486d4 admin_liche_1125 2021-11-25 11:33:02 +08:00
lccsw a7e3f634e4 edit-api-check_biz_type 2021-11-24 13:41:11 +08:00
dengbw 9ee2972179 api_material_1124 2021-11-24 10:16:41 +08:00
lccsw 6e56814fcd edit-admin-export_order 2021-11-23 13:49:07 +08:00
lccsw 608156e5ec add-admin-export_order 2021-11-23 11:42:02 +08:00
lccsw 79b45bf308 edit-create-inten_order 2021-11-22 15:47:06 +08:00
lccsw eb07c8ad89 edit-api-order_list 2021-11-22 11:24:40 +08:00
lccsw 3ef1be025e add-common-auto_config 2021-11-19 16:41:38 +08:00
dengbw 34d362ad84 api_material_1119 2021-11-19 13:34:22 +08:00
lccsw 7a040ad69c add-srv-company 2021-11-19 10:33:40 +08:00
lccsw fa3f1245fd edit-admin-ck_pay 2021-11-18 16:31:10 +08:00
lccsw 3185e82471 edit-html 2021-11-18 15:54:07 +08:00
lccsw b93af8a49a edit-api-edit_order 2021-11-18 15:47:45 +08:00
dengbw c3303bd751 admin_orders_1118 2021-11-18 14:16:00 +08:00
dengbw a16f861298 channel_1117_5 2021-11-17 16:49:37 +08:00
dengbw 5c16df603f channel_1117_4 2021-11-17 16:33:51 +08:00
dengbw 50bab18192 channel_1117
channel_1117_2

channel_1117_3
2021-11-17 15:20:44 +08:00
lccsw 859cc89c2b edit-admin-order_list 2021-11-17 10:11:10 +08:00
lccsw 2b3b9bf751 add-plan-order_time 2021-11-16 17:10:49 +08:00
dengbw 4e3d8a0d38 api_material_1116_3 2021-11-16 17:08:34 +08:00
dengbw 3e23221477 api_material_1116_2 2021-11-16 17:06:39 +08:00
lccsw 91b16bb314 edit-admin-order_loan 2021-11-16 15:20:21 +08:00
lccsw ab2262fea3 edit-liche-robot3 2021-11-16 12:01:25 +08:00
lccsw 26233358a8 edit-liche-robot2 2021-11-16 11:53:29 +08:00
lccsw d3eee6e3a3 edit-liche-robot 2021-11-16 11:29:55 +08:00
lccsw 999bee80e4 edit-admin-list 2021-11-16 11:19:40 +08:00
dengbw b358f132f3 api_material_1116 2021-11-16 11:05:01 +08:00
lccsw 43ab0d3060 edit-api-user_orders 2021-11-16 09:24:11 +08:00
lccsw 5192f59f2a edit-admin-order_list 2021-11-15 14:30:51 +08:00
lccsw 90af075af3 edit-api-config_img 2021-11-15 11:47:35 +08:00
lccsw 84bd314848 edit-api-update_user_order 2021-11-14 14:59:17 +08:00
lccsw 8198d6df68 edit-api-create_order 2021-11-14 14:37:06 +08:00
dengbw f439f0c165 api_material_1112 2021-11-12 16:33:13 +08:00
lccsw fbdd457394 edit-model-order_delivery_info 2021-11-12 16:07:58 +08:00
lccsw 0f4fd655d0 edit-admin-order_detail 2021-11-12 13:41:18 +08:00
lccsw a3901ced54 add-api-delivery 2021-11-12 11:10:49 +08:00
lccsw 10469cbed9 edit-api-entrust 2021-11-12 11:09:06 +08:00
dengbw 195c8e97e0 goods_logs_1111_4 2021-11-11 17:56:19 +08:00
dengbw 4cdc6eba1b goods_logs_1111_3 2021-11-11 16:54:57 +08:00
lccsw 780f470ff2 edit-admin-order_detail2 2021-11-11 16:12:46 +08:00
lccsw 6eb24e023e edit-admin-order_detail 2021-11-11 16:09:44 +08:00
dengbw f0895b4139 goods_logs_1111_2 2021-11-11 11:04:13 +08:00
dengbw 5f83d9a92a goods_logs_1111 2021-11-11 10:55:10 +08:00
lccsw 2489cf390a edit-cancel-brand_id=4 2021-11-10 20:47:04 +08:00
lccsw 0552b81510 edit-third_party-alipay 2021-11-10 10:43:53 +08:00
lccsw 287e444994 edit-third_party-ali 2021-11-09 17:58:45 +08:00
dengbw 38e30d2642 goods_logs_1109_4 2021-11-09 15:22:20 +08:00
lccsw a83dc2e5cd edit-api-contract 2021-11-09 14:17:50 +08:00
dengbw 346d75b7d3 goods_logs_1109_3 2021-11-09 14:12:49 +08:00
dengbw d7c8b79e0a goods_logs_1109_2 2021-11-09 14:01:08 +08:00
dengbw 7364745129 goods_logs_1109 2021-11-09 13:45:57 +08:00
lccsw db3b66e088 edit-api-money_json 2021-11-08 16:26:17 +08:00
lccsw 8e75502a9c edit-api-order_list 2021-11-08 15:33:32 +08:00
dengbw e0ef297acb Merge branch 'fea#goods' into dev 2021-11-08 14:22:03 +08:00
dengbw 522cb99ac4 goods_logs_1108 2021-11-08 14:20:26 +08:00
lccsw b5cd2d1fa2 edit-api-order2 2021-11-07 19:25:54 +08:00
lccsw 7aad2fe390 edit-api-order 2021-11-07 19:22:57 +08:00
lccsw 943f2db8fb edit-api-sum_deal_log 2021-11-06 22:45:53 +08:00
lccsw 4ff3416c7d add-api-test_script 2021-11-06 22:45:49 +08:00
lccsw 000e423568 edit-api-services 2021-11-06 15:58:32 +08:00
lccsw dfc489fa9e edit-api-protocol 2021-11-05 22:22:09 +08:00
lccsw 747084be3b edit-qywhat-robot 2021-11-05 16:07:05 +08:00
lccsw 42c6d30228 edit-api-order_detail 2021-11-04 16:59:05 +08:00
lccsw 35af697f11 add-api-cal-order 2021-11-04 16:17:40 +08:00
dengbw d5b347d0c9 api_biz_1104_2 2021-11-04 11:02:36 +08:00
dengbw a834760394 api_biz_1104 2021-11-04 10:39:08 +08:00
dengbw ad955949e6 api_biz_1103_7 2021-11-03 18:09:42 +08:00
dengbw 3c453d43d3 api_biz_1103_6 2021-11-03 17:23:03 +08:00
dengbw e017854962 api_biz_1103_5 2021-11-03 17:12:26 +08:00
dengbw 407547c718 api_biz_1103_4 2021-11-03 17:08:20 +08:00
dengbw 6a5e5dd11f api_biz_1103_3 2021-11-03 16:40:18 +08:00
dengbw 40ebdc03b0 api_biz_1103_2 2021-11-03 14:48:42 +08:00
dengbw 4606a018ea api_biz_1103 2021-11-03 11:44:20 +08:00
lccsw 7fa658198a edit-admin-order_detail 2021-11-03 10:23:43 +08:00
lccsw aabb0e6579 edit-admin-cus_cancel 2021-11-03 09:57:27 +08:00
dengbw d533f9de9f admin_customer_1102 2021-11-02 17:34:20 +08:00
dengbw 20a447aeda api_licheb_1102_2 2021-11-02 14:49:22 +08:00
lccsw 2542dc14d7 edit-admin-agent3 2021-11-02 11:22:50 +08:00
lccsw 1236cd3e42 edit-admin-edit_agent2 2021-11-02 11:20:13 +08:00
lccsw b59fa453f7 edit-admin-edit_agent 2021-11-02 11:15:04 +08:00
lccsw 82ab3df9f1 edit-admin-edit_order 2021-11-02 11:09:07 +08:00
lccsw df3d317b83 edit-api-cus_list 2021-11-02 10:24:14 +08:00
lccsw 2ee94179b5 edit-admin-edit_order 2021-11-02 10:20:50 +08:00
dengbw 6c0824e1b6 api_licheb_1102 2021-11-02 10:17:26 +08:00
dengbw 66a6da8cc0 admin_orderList_1101 2021-11-01 14:48:32 +08:00
lccsw 03c571d832 edit-api-create_order 2021-11-01 14:22:57 +08:00
dengbw 278011ce0e admin_order_1101 2021-11-01 10:32:36 +08:00
lccsw 5fdcca327a edit-api-order_time and filter customer 2021-11-01 10:00:35 +08:00
lccsw 68a72d531f edit-admin-clues-filter-mobile 2021-11-01 09:48:20 +08:00
xiaoyu d995cd0b9c order_time
order_time

order_time
2021-10-31 01:30:11 +08:00
dengbw 2d36599055 admin_order_1029 2021-10-29 17:56:11 +08:00
lccsw 760272647c add-api-white_list 2021-10-29 12:32:47 +08:00
dengbw a79b99f557 admin_customer_1029 2021-10-29 09:36:37 +08:00
lccsw cdbe15eb05 edit-auto-cars 2021-10-28 18:56:14 +08:00
dengbw adbea9690d admin_goods_1028_4 2021-10-28 17:56:32 +08:00
lccsw 9f5bbc070f edit-api-edit_order 2021-10-28 17:45:13 +08:00
dengbw ea9729211d admin_goods_1028_3 2021-10-28 16:20:04 +08:00
dengbw bc74ec8ba2 admin_goods_1028_2 2021-10-28 16:10:42 +08:00
dengbw ba07dc0672 admin_goods_1028 2021-10-28 15:54:03 +08:00
lccsw 07df6b5031 edit-admin-fh_agent 2021-10-28 09:58:24 +08:00
dengbw 7a2fe961fd api_licheb_1027 2021-10-27 16:45:44 +08:00
dengbw 14b6ef65ff alisms_1027_3 2021-10-27 15:43:45 +08:00
lccsw c5ddf097f9 edit-admin-bill_status 2021-10-27 15:07:08 +08:00
lccsw 261185ee7a edit-bill-status 2021-10-27 14:41:48 +08:00
dengbw 3522ceb5bc alisms_1027_2 2021-10-27 11:28:57 +08:00
dengbw fc591adc9c Merge branch 'fea#licheb_sms' into dev 2021-10-27 11:05:16 +08:00
dengbw d5f4ced1e8 alisms_1027 2021-10-27 11:04:23 +08:00
lccsw d80f6b8fe0 edit-api-edit_order 2021-10-27 11:03:12 +08:00
lccsw 923fbf53d5 edit-admin-order_info 2021-10-27 09:25:28 +08:00
lccsw 4f09a056e4 edit-admin-order_detail 2021-10-26 14:28:52 +08:00
dengbw 0d52d7acf5 admin_customer_1026 2021-10-26 11:32:20 +08:00
lccsw 789ce6589e edit-api-licheb-sms_ck 2021-10-26 11:00:07 +08:00
lccsw 792c34349a add-api-edit-order 2021-10-26 10:53:27 +08:00
dengbw d4fe6d5086 customer_visit_1026 2021-10-26 10:38:08 +08:00
dengbw 127106d927 Template_1025_2 2021-10-25 17:48:58 +08:00
lccsw da3d276408 edit-api-static 2021-10-25 16:11:10 +08:00
dengbw 6b3c38a5df Template_1025 2021-10-25 15:31:26 +08:00
dengbw d636720eaf customer_visit_1025_7 2021-10-25 11:53:43 +08:00
dengbw 0c873747e4 customer_visit_1025_6 2021-10-25 11:33:40 +08:00
dengbw 2af16e3922 customer_visit_1025_5 2021-10-25 11:26:24 +08:00
dengbw facf9e3c5e customer_visit_1025_4 2021-10-25 10:56:55 +08:00
dengbw 9e3e6fd2df customer_visit_1025_3 2021-10-25 10:38:00 +08:00
dengbw 823711626b customer_visit_1025_2 2021-10-25 10:34:26 +08:00
dengbw b10d3c9289 Merge branch 'fea#customers_visit' into dev 2021-10-25 10:02:24 +08:00
dengbw cb7a5a2cb9 customer_visit_1025 2021-10-25 10:02:04 +08:00
dengbw 6097055437 admin_order_1025 2021-10-25 09:37:56 +08:00
lccsw e0d1cd6865 edit-admin-pay_log 2021-10-25 09:16:45 +08:00
dengbw e693c86fb7 admin_order_1021 2021-10-21 17:51:23 +08:00
lccsw 8cb77421c4 edit-api-price_finance 2021-10-20 17:55:50 +08:00
lccsw 59aacf2ad1 edit-admin-limit_city 2021-10-20 16:37:23 +08:00
lccsw 649e8d02fa edit-admin-edit_order2 2021-10-20 11:48:06 +08:00
lccsw f50749984b edit-admin-edit_order 2021-10-20 11:45:46 +08:00
dengbw b933d64af1 admin_material_1019 2021-10-19 13:53:00 +08:00
lccsw 03cc6536c1 edit-admin-user_css 2021-10-19 11:17:52 +08:00
lccsw 7172a6e47a add-admin-biz_limit 2021-10-19 11:13:23 +08:00
lccsw 587c5c3905 edit-api company_id=1 2021-10-18 21:21:28 +08:00
dengbw 1fc0f294d2 admin_material_1018_2 2021-10-18 15:10:35 +08:00
lccsw 22525c2089 add-alipay-sdk 2021-10-18 14:56:21 +08:00
dengbw 5f15803f17 admin_material_1018 2021-10-18 14:08:10 +08:00
dengbw 9311d5f6db admin_material_1015_3 2021-10-15 17:06:09 +08:00
dengbw 6e367599a8 admin_material_1015_2 2021-10-15 16:27:50 +08:00
dengbw 7e133c8efb admin_material_1015 2021-10-15 16:23:20 +08:00
lccsw 9aad7bbe85 edit-api-stat 2021-10-15 14:18:06 +08:00
lccsw 7365661d29 edit-admin-finsh_agent 2021-10-15 14:13:14 +08:00
dengbw 13b979c314 admin_orders_1015 2021-10-15 11:15:04 +08:00
dengbw f85cf9207d admin_customer_1015 2021-10-15 10:08:03 +08:00
dengbw 0827934f66 admin_customer_1014_2 2021-10-15 00:02:49 +08:00
dengbw 00098b5fe4 admin_customer_1014 2021-10-14 23:52:27 +08:00
dengbw 07b94e918b material_1014_3 2021-10-14 17:51:27 +08:00
lccsw 25984704a4 edit-plan-robot2 2021-10-14 17:43:02 +08:00
lccsw 19138006d4 edit-plan-robot 2021-10-14 17:38:55 +08:00
lccsw d70d0afbaf edit-api-xz_stat 2021-10-14 16:53:32 +08:00
lccsw 0a86abaa5a edit-admin-order_loan 2021-10-14 16:42:15 +08:00
dengbw 2706cae481 material_1014 2021-10-14 15:54:18 +08:00
lccsw 3f4a194864 edit-common-show_srv_money 2021-10-14 15:17:30 +08:00
lccsw 08a0409a6d add-script-up_money_json 2021-10-14 15:02:59 +08:00
lccsw ded7b54205 edit-api-create_clue 2021-10-14 13:40:00 +08:00
lccsw 145f71a362 edit-liche-robot 2021-10-13 17:01:02 +08:00
lccsw 44c3a90422 edit-admin-filter biz_id=1 2021-10-13 14:25:45 +08:00
lccsw 219b6e5b80 edit-admin-html 2021-10-13 14:06:04 +08:00
lccsw 6ee37c1e1e edit-admin-order_style 2021-10-12 16:45:13 +08:00
lccsw 6b307e79c7 edit-admin-order_detail 2021-10-12 16:27:49 +08:00
lccsw 94045a6da6 edit-api-log_filter 2021-10-12 13:55:38 +08:00
lccsw cacafadce3 edit-admin-order_detail 2021-10-12 11:57:45 +08:00
lccsw 0f441e7c68 edit-api-filter_limimt 2021-10-12 11:03:03 +08:00
lccsw 52a6d2880d add-api-create_clues 2021-10-12 10:42:21 +08:00
lccsw 20297a42e6 edit-qyrobot 2021-10-12 10:33:42 +08:00
lccsw 47a1a58bca edit-qyrobot-count 2021-10-11 09:15:01 +08:00
lccsw 94343c9137 edit-qyrobot 2021-10-10 19:48:41 +08:00
xxb 6d23cb28aa liche update for upload file bug 2021-10-09 17:13:01 +08:00
dengbw c317e6fe68 admin_goods_109 2021-10-09 16:55:33 +08:00
lccsw 4fbb5f9787 add-api-qywechat-robot 2021-10-09 14:43:05 +08:00
lccsw 1c83ac1591 edit-liche-pay-desc 2021-10-08 17:35:41 +08:00
xxb cba357af08 admin liche update for order bill upload as file 2021-10-08 17:11:10 +08:00
lccsw a301579685 api-liche-pay-bug 2021-10-08 10:24:49 +08:00
dengbw 86a82a5804 admin_orders_105 2021-10-05 22:19:14 +08:00
lccsw 5c55fe5e24 edit-api-liche-order 2021-10-04 17:08:36 +08:00
lccsw b3b3fcc4a8 edit-api-licheb-user 2021-09-30 17:58:51 +08:00
lccsw cab0b63920 edit-api-cus_order 2021-09-30 17:51:54 +08:00
lccsw 9c81f4f7ab edit-admin-goods_status 2021-09-30 17:29:31 +08:00
lccsw 8674d1f661 edit-amdin-add_paylog and api filter brand_id =3 2021-09-30 15:59:22 +08:00
dengbw 49291c7e0a admin_orders_930_3 2021-09-30 15:46:57 +08:00
lccsw b1e74ce3e9 add-admin-paylog 2021-09-30 11:29:31 +08:00
dengbw 6fffcdfa35 admin_orders_930 2021-09-30 11:13:41 +08:00
dengbw 08ea631ee1 admin_orders_929_2 2021-09-29 16:08:26 +08:00
lccsw 5049863033 edit-admin-srv_money 2021-09-29 15:53:15 +08:00
lccsw a92f4455a8 edit-admin-loan_order 2021-09-29 15:02:15 +08:00
dengbw 10e8380f59 admin_orders_929 2021-09-29 10:06:58 +08:00
lccsw af17244d1f edit-admin-edit-loan 2021-09-28 15:00:46 +08:00
dengbw 5f1818f35d admin_orders_928 2021-09-28 11:43:47 +08:00
lccsw f236f74de0 edit-api-pay 2021-09-28 09:40:08 +08:00
dengbw ede3302a52 admin_orders_927_4 2021-09-27 17:56:35 +08:00
dengbw 7430916dd8 admin_orders_927_3 2021-09-27 15:58:25 +08:00
dengbw 3a57dcf0f8 admin_orders_927
admin_orders_927_2
2021-09-27 15:50:20 +08:00
lccsw e91369801d edit-licheb-create_order 2021-09-27 15:13:21 +08:00
lccsw e58f159182 edit-api-licheb 2021-09-27 12:44:33 +08:00
lccsw 535194cb74 edit-api-licheb-biz_status 2021-09-27 08:51:40 +08:00
lccsw 18b54c46e1 add-api-licheb-biz_status 2021-09-26 21:29:21 +08:00
dengbw 6d49af1bd8 admin_orders_926_2 2021-09-26 17:45:45 +08:00
lccsw 9277a93044 edit-api-licheb-order_list 2021-09-26 16:31:33 +08:00
lccsw b33c2b1347 add-script-up_order2 2021-09-26 13:58:50 +08:00
lccsw 6cb9f57d33 add-script-up_order 2021-09-26 13:58:42 +08:00
dengbw f92ce443c5 admin_orders_926 2021-09-26 11:31:22 +08:00
xxb eb8fdd6e06 liche update for admin sys addr unrepeat at county 2021-09-26 11:11:48 +08:00
lccsw 278740c87d edit-liche-orders 2021-09-24 22:03:42 +08:00
xxb 254bfbfd55 liche update for admin uploadpdf bug 2021-09-24 15:01:34 +08:00
dengbw fc5aa25f02 admin_orders_924_4 2021-09-24 14:26:28 +08:00
dengbw 958e050584 admin_orders_924_3 2021-09-24 11:47:54 +08:00
xxb 7fc3770f44 liche update for api idcard check uname 2021-09-24 09:45:02 +08:00
dengbw c5146da57a admin_orders_924
admin_orders_924_2
2021-09-24 09:38:02 +08:00
lccsw 96b58147c3 edit-admin-change_old_order2 2021-09-23 20:38:38 +08:00
lccsw 8c65165cc4 edit-admin-change_old_order 2021-09-23 20:33:34 +08:00
lccsw 286f0f7e7f add-admin-change_old_order 2021-09-23 20:11:22 +08:00
dengbw 0b06743771 admin_orders_923_2 2021-09-23 17:56:55 +08:00
dengbw 72abef3b19 admin_orders_923 2021-09-23 17:32:32 +08:00
xxb 2ad0692b00 liche update for admin auto attr list pager bug 2021-09-23 14:11:09 +08:00
dengbw 4eda5ad604 admin_customer_923 2021-09-23 09:34:26 +08:00
xxb 0ab4b6a1b6 liche update for admin order upload idcard 2021-09-22 19:55:32 +08:00
dengbw 61b2befd09 admin_customer_922 2021-09-22 16:22:12 +08:00
lccsw 6c6cc4e1c4 edit-admin-ckcar 2021-09-20 09:15:22 +08:00
dengbw a459fdd16b admin_orders_919 2021-09-19 23:24:20 +08:00
lccsw f5ce3a7a69 add-admin-finish_pay 2021-09-19 15:11:25 +08:00
lccsw ae0f217a10 edit-api-licheb-filter-brand_id 2021-09-18 14:48:43 +08:00
dengbw 45969d90ed admin_customer_918 2021-09-18 14:09:29 +08:00
lccsw b27ee071f4 edit-licheb-city-filter 2021-09-18 13:59:39 +08:00
lccsw 16a62e5a71 add-licheb-city-filter 2021-09-18 11:54:39 +08:00
dengbw 1c914d7f05 admin_orders_917_2 2021-09-17 17:58:42 +08:00
lccsw 1f6b5e5b1c edit-licheb-statics 2021-09-17 17:51:22 +08:00
lccsw cc96f66bfe edit-licheb-stat-filter-test 2021-09-17 17:51:22 +08:00
lccsw 7dd4b93161 edit-liche-stat 2021-09-17 17:51:22 +08:00
lccsw 606c272508 add-licheb-group_type 2021-09-17 17:51:16 +08:00
dengbw cf6fc003c6 admin_orders_917 2021-09-17 17:50:40 +08:00
dengbw 43d9b35318 admin_loans_916 2021-09-16 10:21:06 +08:00
lccsw 5beba511f8 edit-api-licheb-up-clues 2021-09-15 16:44:50 +08:00
dengbw a3bdddb17a admin_clues_915 2021-09-15 15:58:20 +08:00
xxb b70a503142 liche update for admin order upload bill not update item bill time bug 2021-09-15 11:09:51 +08:00
dengbw 2a6268fb67 api_bobing_915 2021-09-15 10:07:20 +08:00
xxb 7161233eb9 liche update for admin finance get select car bug 2021-09-15 09:55:13 +08:00
dengbw 332aea3696 admin_customers_914_5 2021-09-14 17:37:04 +08:00
xxb 01b96d2527 liche update for admin licheb edit biz auto city 2021-09-14 16:57:54 +08:00
dengbw a0029a9441 admin_customers_914_4 2021-09-14 16:29:44 +08:00
xxb e81c1b8c72 liche update for admin goods show when id=1 2021-09-14 14:53:06 +08:00
xxb eb6b2efbed liche update for admin goods show order user 2021-09-14 14:38:09 +08:00
xxb e95a593b73 liche update for super admin not check ip and show full mobile 2021-09-14 11:26:24 +08:00
dengbw 55de3071ef admin_customers_914_3 2021-09-14 11:14:54 +08:00
dengbw 828e341319 admin_customers_914_2 2021-09-14 11:14:54 +08:00
dengbw ae95b6623e admin_customers_914 2021-09-14 11:14:54 +08:00
dengbw de7f20b84b admin_customers_914 2021-09-14 10:38:30 +08:00
xxb b4ab74ec3a liche update for admin order detail display change 2021-09-13 17:56:46 +08:00
dengbw 917fd44ac2 admin_customers_913_4 2021-09-13 17:36:41 +08:00
xxb dd6c324bf0 liche update for admin order search by admin_id like 2021-09-13 17:30:59 +08:00
dengbw d6fb5412fb admin_customers_913_3 2021-09-13 16:22:25 +08:00
dengbw 396d56c716 admin_customers_913_2 2021-09-13 16:12:26 +08:00
xxb 7543794088 liche update for admin order lists search by admin_id 2021-09-13 16:10:59 +08:00
dengbw f83b606d08 admin_customers_913 2021-09-13 15:49:28 +08:00
xxb 8bfff6c85f admin update for upload file 2021-09-13 15:20:07 +08:00
dengbw 1869fcf420 bobing_912 2021-09-12 15:28:58 +08:00
xxb 93e4051f80 liche update for admin clues lists import bug 2021-09-10 17:36:06 +08:00
lccsw 42cc04d73b edit-api-liche-edit-status 2021-09-10 16:07:00 +08:00
lccsw 89a138ab3b edit-admin-finance 2021-09-10 15:50:30 +08:00
dengbw 0e5a2095e0 bobing_910_6 2021-09-10 15:47:21 +08:00
dengbw bc77c64769 bobing_910_4 2021-09-10 15:43:10 +08:00
xxb 4139b4862f liche update for admin goods sold lists show sold_time from bill_time 2021-09-10 15:42:12 +08:00
xxb 3a7779c1ee liche update for admin goods sold lists bug 2021-09-10 15:22:57 +08:00
xxb b110a5f265 liche update for admin goods sold lists 2021-09-10 15:07:26 +08:00
dengbw a059ea283d bobing_910_3 2021-09-10 14:43:33 +08:00
xxb a09909c203 liche update for admin goods sold lists 2021-09-10 14:14:13 +08:00
lccsw 715fc1d4e7 edit-api-stop_profit_sharing 2021-09-10 13:41:29 +08:00
dengbw c3c7b992e0 bobing_910_2 2021-09-10 11:06:42 +08:00
dengbw f102a3113d bobing_910 2021-09-10 11:02:18 +08:00
lccsw 83af240048 stop-bobing-mj 2021-09-10 10:45:33 +08:00
xxb 46d83b6bbc liche update for admin car search v_id 2021-09-10 10:42:18 +08:00
lccsw 99e7c944b8 edit-liche-api 2021-09-10 09:15:54 +08:00
xiaoyu 2c9330e61a bobing 2021-09-09 22:18:37 +08:00
lccsw c1a3e46af8 edit-licheb-api 2021-09-09 21:25:11 +08:00
xxb a35e29b156 liche update for admin clues search by en_time bug 2021-09-09 21:10:43 +08:00
xxb 48d141caf6 liche update for admin clues search by en_time 2021-09-09 21:02:10 +08:00
xxb cfd3ab8c24 liche update for admin clues list show en_time 2021-09-09 20:41:09 +08:00
xxb 6883409803 goods update for admin list bug 2021-09-09 19:48:16 +08:00
xxb 534c788dad liche update for admin goods show sold lists 2021-09-09 19:30:06 +08:00
lccsw ef18b76743 add-admin-uporder_money 2021-09-09 19:25:47 +08:00
dengbw 7536b94f95 bobing_909_6 2021-09-09 17:56:48 +08:00
dengbw 10d4b08930 bobing_909_5 2021-09-09 17:51:04 +08:00
dengbw b1f26f9f99 bobing_909_4 2021-09-09 17:03:01 +08:00
lccsw 242c85b77f add-model-finance-num 2021-09-09 14:49:37 +08:00
dengbw ccfa12da60 bobing_909_3 2021-09-09 14:27:04 +08:00
dengbw 3b32bffd3c bobing_909_2 2021-09-09 13:44:24 +08:00
dengbw 4925bcdb90 bobing_909 2021-09-09 13:35:56 +08:00
dengbw 1b3f40c6ad bobing_908_5 2021-09-08 21:51:21 +08:00
dengbw 07d4acaaad bobing_908_4 2021-09-08 19:50:07 +08:00
lccsw 53c2c9e13d add-auto-finance 2021-09-08 18:02:11 +08:00
xxb cf3c0d7745 liche update for admin order detail display mv 2021-09-08 17:21:44 +08:00
dengbw 924a615e0f bobing_908_3 2021-09-08 11:17:30 +08:00
xxb b688860162 liche update for admin order baoxian update load pdf file 2021-09-08 11:11:42 +08:00
dengbw bf4f62c07a bobing_908_2 2021-09-08 10:13:44 +08:00
dengbw 3d74c3f8ba bobing_908 2021-09-08 10:01:12 +08:00
dengbw eb67890d30 bobing_903_4 2021-09-07 17:46:41 +08:00
xxb d492ed22bc liche update for admin goods edit check need field 2021-09-07 14:11:24 +08:00
xxb 3c3b727b60 liche update for admin goods export micro change 2021-09-07 11:56:04 +08:00
lccsw 2cde142fa1 edit-licheb-create_order 2021-09-07 11:24:44 +08:00
xxb af181686dd liche update for admin receiver order lists can reset condition 2021-09-06 21:00:57 +08:00
lccsw d79ac9a713 edit-liche-group_code 2021-09-06 10:53:07 +08:00
xxb a6df2cfb9c liche update for goods exxport bug 2021-09-06 10:02:25 +08:00
xxb edbce166e4 liche update for admin order detail dispay contract only 2021-09-03 17:38:20 +08:00
lccsw c99c9a6b32 edit-api-liche-html 2021-09-03 17:36:42 +08:00
dengbw a85bfc5095 bobing_903_4 2021-09-03 16:51:51 +08:00
xxb eaff4db9eb liche update for admin order detail display mv 2021-09-03 16:32:17 +08:00
xxb dd4718a580 liche update for admin order list modify 2021-09-03 16:15:09 +08:00
dengbw c1689e8233 bobing_903_3 2021-09-03 15:56:16 +08:00
xxb 15562067aa liche update for admin order modfy 2021-09-03 15:21:38 +08:00
dengbw a044af6a01 bobing_903_2 2021-09-03 15:20:24 +08:00
dengbw 54b650ed26 bobing_903 2021-09-03 14:40:57 +08:00
xxb ef3eea60eb liche update for admin order modify address longer 2021-09-03 14:20:40 +08:00
xxb e4bb71f2e3 liche update for admin order modify 2021-09-03 14:09:45 +08:00
xxb dddd018982 liche update for admin order modify 2021-09-03 11:56:01 +08:00
lccsw 88ff58090d edit-api-create_order2 2021-09-03 11:39:15 +08:00
lccsw 73eb828768 edit-api-create_order 2021-09-03 11:32:45 +08:00
lccsw f1a2447580 edit-library-require 2021-09-02 20:52:13 +08:00
lccsw bf51b24cfa edit-admin-wx-profitsharingfinish 2021-09-02 20:28:36 +08:00
lccsw 80ea7ba786 add-admin-wx-profitsharingfinish 2021-09-02 19:15:49 +08:00
xxb d792056cfd liche update for admin auto cars attr exporde 2021-09-02 16:05:15 +08:00
xxb c26bde6854 liche update for admin clues and customer lists select bug 2021-09-02 10:04:10 +08:00
lccsw a71bcb7333 edit-api-type_name 2021-09-01 20:55:13 +08:00
lccsw a5ee4a06a2 edit-api-liche-order-status 2021-09-01 19:25:18 +08:00
xxb 9eac7942c8 liche update for admin order modify 2021-09-01 17:56:17 +08:00
dengbw 8cfe8f7f63 bobing_901_7
bobing_901_8
2021-09-01 17:33:36 +08:00
dengbw 810f47ce02 bobing_901_6 2021-09-01 16:56:25 +08:00
dengbw d0cd8310ad bobing_901_5 2021-09-01 15:22:13 +08:00
dengbw 13023b91f0 bobing_901_4 2021-09-01 14:44:37 +08:00
lccsw 82da6d5ecb edit-api-licheb-edit-status 2021-09-01 10:36:34 +08:00
dengbw e5c01188fc bobing_901_3 2021-09-01 10:27:39 +08:00
dengbw 7ac453d9ad bobing_901_2 2021-09-01 09:58:37 +08:00
dengbw ff059474aa Merge branch 'fea#bobing2021_2' into dev 2021-09-01 09:50:31 +08:00
dengbw 25ca75b964 bobing_901 2021-09-01 09:49:40 +08:00
xxb 014729cc93 liche update for admin goods list sort 2021-08-31 17:44:04 +08:00
lccsw a14e5487f3 edit-api-contract-content 2021-08-31 15:25:01 +08:00
xxb 925f010d37 liche update for admin goods lists show auto fine bug 2021-08-31 10:44:15 +08:00
lccsw 0156bdfb2b add-api-licheb-customer-city 2021-08-31 10:01:32 +08:00
lccsw bf55e6ecb7 edit-licheb-comster-status 2021-08-30 14:17:46 +08:00
xxb 4b9c3084bb liche update for admin goods lists edit th 2021-08-30 09:57:59 +08:00
lccsw 8bdac57426 edit-api-liche-apt 2021-08-27 22:14:00 +08:00
xiaoyu c214d6afbc city county 2021-08-27 20:51:16 +08:00
xiaoyu 32e21670dd log 2021-08-27 20:42:13 +08:00
xiaoyu d31b314b9a log 2021-08-27 20:42:01 +08:00
xxb 7c5e194b45 liche update for admin goods better 2021-08-27 20:39:10 +08:00
xiaoyu 5197ec6ea7 customer cfrom 2021-08-27 20:02:19 +08:00
xiaoyu 86f9baffac city_code 2021-08-27 19:48:45 +08:00
xiaoyu c94a5705ed cf_title 2021-08-27 19:22:38 +08:00
lccsw 4810b3798b edit-admin-clues-edit 2021-08-27 17:22:25 +08:00
lccsw d6464e50f1 edit-admin-clues 2021-08-27 17:12:25 +08:00
lccsw a910069bfe edit-admin-clues-nearby-biz 2021-08-27 15:25:39 +08:00
lccsw b3d2027381 edit-admin-clues-log 2021-08-26 19:15:15 +08:00
xxb 26822f891d liche update for admin goods add auto_fine 2021-08-26 16:47:47 +08:00
lccsw 0ef24b9818 edit-admin-clues-cfrom 2021-08-26 13:56:52 +08:00
lccsw b688dece36 add-clues-position 2021-08-26 10:07:04 +08:00
lccsw 8d73647558 edit-admin-liche-cms 2021-08-25 19:02:16 +08:00
lccsw 6418ceac08 edit-liche-clues_cfrom 2021-08-25 17:44:08 +08:00
xxb 3e0af04104 liche update for admin goods list select car stype bug 2021-08-25 17:25:53 +08:00
xxb ebafbcf5cf liche update for goods list show modify 2021-08-25 17:08:13 +08:00
lccsw 7d95566716 edit-api-licheb-data2 2021-08-25 14:39:28 +08:00
lccsw a1c9c2949e edit-api-licheb-data 2021-08-25 14:05:09 +08:00
lccsw 088fcbaa70 edit-api-xz 2021-08-25 10:23:13 +08:00
xxb 56037000ad liche update for admin goods do better 2021-08-24 20:42:52 +08:00
xxb f06825359c liche update for admin goods view and clues list follower show reapair 2021-08-24 16:06:02 +08:00
lccsw 89aac03574 add-api-sign_cache 2021-08-23 20:10:58 +08:00
lccsw e0162a48aa edit-api-auto_series 2021-08-23 15:55:55 +08:00
xxb 27e329d073 liche update for lists show total at table header 2021-08-23 14:13:56 +08:00
lccsw 9d33f89bcf edit-api-auto 2021-08-23 13:48:17 +08:00
xxb 54b8a890f4 liche update for biz list search by company and clues cfrom support level2 when clues add 2021-08-23 11:48:06 +08:00
lccsw d34afc14c7 edit-api-liche-static 2021-08-21 09:42:06 +08:00
xxb a7be63d2df liche update for admin sys.sql edit 2021-08-20 20:55:46 +08:00
xxb 057fd4d5a4 liche update for admin auto and goods edit 2021-08-20 20:25:59 +08:00
lccsw 5837daace7 add-liche-dealer-apply 2021-08-20 17:53:47 +08:00
xxb 84f40db91a liche update for admin user support super majia 2021-08-19 19:55:17 +08:00
xxb f498cefade liche update for admin clues edit city_code 2021-08-19 16:53:21 +08:00
xxb eabec524c9 goods update for admin 2021-08-19 11:39:00 +08:00
lccsw 72acb9435f edit-api-fee_carno 2021-08-19 10:55:14 +08:00
xxb f0bbba92e4 area model update for get city first char 2021-08-19 10:41:09 +08:00
xxb 1baba5913e liche update for admin brand add bug 2021-08-18 14:24:16 +08:00
lccsw 0dd4ad3749 edit-api-area2 2021-08-18 14:03:25 +08:00
lccsw abcaf9eeed edit-api-area 2021-08-18 13:47:59 +08:00
xxb d20c0c3690 admin auto update for not check power when method start with json 2021-08-18 11:00:32 +08:00
lccsw 82c9b2ecbe edit-api-auto-series2 2021-08-18 10:54:20 +08:00
lccsw c9510decf6 edit-api-auto-series 2021-08-18 10:38:15 +08:00
lccsw 80c1412dd3 edit-home-require-js 2021-08-17 17:47:59 +08:00
lccsw b894ad93aa edit-exclude-common-vendor 2021-08-17 17:36:52 +08:00
dengbw 64df666fee admin_goods_817_3 2021-08-17 17:24:18 +08:00
lccsw bcdd9510af add-home-toole 2021-08-17 17:06:33 +08:00
dengbw 4d504db111 admin_goods_817
admin_goods_817_2
2021-08-17 16:46:03 +08:00
lccsw b8568c6195 edit-licheb-contracts 2021-08-16 17:31:32 +08:00
老叶 01bd81913f Merge branch 'dev' of http://git.haodian.cn:8081/lcc/liche into dev 2021-08-16 15:42:09 +08:00
老叶 8b4bf3bc1b h5 2021-08-16 15:42:00 +08:00
xxb 8b641618bb liche update for admin biz add auto brands 2021-08-16 11:59:25 +08:00
lccsw df24267e97 edit-api-licheb 2021-08-14 20:43:35 +08:00
老叶 038c4fd706 车辆交付信息样式修改 2021-08-13 17:00:02 +08:00
lccsw 18a2259123 edit-api-licheb 2021-08-13 15:04:37 +08:00
lccsw 9e0fcd7979 edit-api-licheb 2021-08-13 14:00:58 +08:00
lccsw e3852a373f edit-api-licheb-contract 2021-08-13 13:49:59 +08:00
xxb 67c82e8ec6 liche update for admin auto car edit at new alert 2021-08-13 11:41:34 +08:00
lccsw 45788dda75 edit-api-licheb-opt 2021-08-13 10:55:13 +08:00
xxb 4c7e18b2e9 liche update for admin auto attr edit rm some param 2021-08-12 17:14:32 +08:00
xxb 7b0ab1b3b6 liche update for admin auto car add price book 2021-08-10 15:34:19 +08:00
lccsw 4ca86e1c45 edit-plan-xzcall-video 2021-08-10 11:15:48 +08:00
lccsw debd2e9c75 edit-plan-xcall-video 2021-08-10 11:00:41 +08:00
lccsw c59df3bd92 edit-plan-xcall 2021-08-10 10:58:00 +08:00
xxb 4532374ce1 liche update for admin auto car can edit at lists 2021-08-09 17:21:08 +08:00
lccsw 78ae665df8 edit-xcall-config 2021-08-09 15:37:29 +08:00
xxb 180861136f liche update for admin auto cars edit do 2021-08-09 15:12:49 +08:00
xxb 16ea57dccf liche update for admin auto cars list batch do 2021-08-09 11:17:26 +08:00
xxb 7de4cc406a liche update for admin auto cars manage 2021-08-06 17:43:55 +08:00
xxb 0905e21f57 liche update for item rm column frame_num 2021-08-06 17:43:55 +08:00
lccsw f4113464de edit-liche-enroll 2021-08-06 16:55:31 +08:00
老叶 53d7aa6e9d 协议 2021-08-06 16:36:23 +08:00
xxb 1cbad64009 liche update for admin company add img_seal 2021-08-06 10:12:40 +08:00
lccsw 0e03656397 add-admin-auto 2021-08-06 10:07:23 +08:00
xxb 29b8d51f3d liche update for app cms add bg_img at place buy car banner 2021-08-05 17:11:23 +08:00
xxb 768b210d8c liche update for admin company add wx_mchid 2021-08-05 16:10:57 +08:00
xxb 56ca815fa2 admin sys city update that add fee carno 2021-08-05 16:10:57 +08:00
xxb bcaf7f079a admin update for type and company_id mv from brand to biz 2021-08-05 16:10:56 +08:00
lccsw 21ebf9ad1c edit-api-udata 2021-08-05 15:43:45 +08:00
lccsw 0aebf52d44 edit-liche-api 2021-08-05 15:28:05 +08:00
lccsw fc49260836 edit-licheb-customer 2021-08-05 14:40:21 +08:00
lccsw 5526ed9f51 edit-api-udata 2021-08-04 09:45:04 +08:00
lccsw 13d4785022 edit-api-distribution 2021-08-03 19:27:19 +08:00
lccsw 19bcd3a433 add-api-distribution 2021-08-03 19:13:30 +08:00
lccsw 8e1d8059f2 add-api-distribution 2021-08-03 14:18:41 +08:00
xxb 5d8371d41f liche update for admin order purchase manger 2021-08-03 10:24:29 +08:00
dengbw a75a544cbb admin_topics_802 2021-08-02 11:44:52 +08:00
xxb 91031e721e admin company add credit code 2021-07-30 15:36:14 +08:00
xxb 028a8d80cb admin sys add finance manger and company short is must 2021-07-30 11:45:30 +08:00
xxb 355bd1cb95 liche update for admin company manger 2021-07-29 20:04:23 +08:00
dengbw 3b8337b03f admin_login_729_2 2021-07-29 17:56:05 +08:00
dengbw da64b1a09a admin_login_729 2021-07-29 17:19:35 +08:00
xxb f7a466d23b liche update for admin brand set type 2021-07-29 16:34:00 +08:00
lccsw 0da7eeb90f edit-library-wechat 2021-07-29 14:49:01 +08:00
lccsw daf0ede906 edit-licheb-order 2021-07-29 14:23:10 +08:00
dengbw 5851e5d520 admin_goods-execl_729 2021-07-29 11:46:52 +08:00
xxb 24b3e49378 liche update for admin sys city set area 2021-07-29 10:50:42 +08:00
lccsw 2efb61ff40 edit-api-protocol 2021-07-29 09:20:54 +08:00
lccsw a01db70358 edit-helper-config 2021-07-29 09:12:18 +08:00
lccsw 03ec9b0bfc edit-api-con 2021-07-29 09:12:07 +08:00
lccsw d97403b389 edit-licheb 2021-07-28 20:13:44 +08:00
dengbw 2f8059fb35 admin_orders_728 2021-07-28 17:52:11 +08:00
lccsw d98fae8439 edit-admin-search 2021-07-28 16:18:23 +08:00
dengbw 159e3fe086 admin_xzcall_728 2021-07-28 16:11:02 +08:00
lccsw c440649d38 del-admin-test 2021-07-28 15:48:20 +08:00
lccsw 0c28a0bd58 edit-api-liche_step 2021-07-28 14:43:28 +08:00
xxb 2d7167ebd4 liche update for admin sys mannger not set app_id, cate_id, city_id and platform_id 2021-07-28 14:25:14 +08:00
lccsw a11a48c56c edit-api-img 2021-07-27 19:02:04 +08:00
lccsw 14ba00d116 edit-admin-app_config 2021-07-27 18:56:21 +08:00
dengbw e9959a66a0 admin_clues_727 2021-07-27 16:18:34 +08:00
lccsw b447a30341 edit-api-xz 2021-07-27 16:14:03 +08:00
lccsw a129700f8c edit-api-config 2021-07-27 11:01:34 +08:00
lccsw 57bd1a697a add-admin-app_config 2021-07-27 10:37:59 +08:00
xxb ec6d7d3281 liche update for admin customer control 2021-07-27 10:28:34 +08:00
dengbw 78ab6eee08 admin_clues_726 2021-07-26 14:13:48 +08:00
xxb 205b6a589f liche update for admin clues add view bug 2021-07-26 11:01:26 +08:00
lccsw d825f0aa3d add-api-licheb-cal 2021-07-26 10:41:48 +08:00
lccsw 224b31f8cf edit-admin-sms 2021-07-23 09:26:20 +08:00
xiaoyu c63370bb40 sql 2021-07-22 18:56:03 +08:00
lccsw 83e259d0ba add-sql-file 2021-07-22 18:14:12 +08:00
lccsw 84d41bd284 edit-api-sign 2021-07-22 15:44:34 +08:00
lccsw 0e30de2572 edit-liche-wxapp 2021-07-22 10:01:42 +08:00
dengbw bcf9e7a6dd admin_clues_721_4 2021-07-22 10:01:42 +08:00
dengbw 4c39f8a09d admin_clues_721_3 2021-07-22 10:01:42 +08:00
dengbw db81504cd2 admin_clues_721_2 2021-07-22 10:01:42 +08:00
xxb 5eb19c563b liche update for cules list bug 2021-07-22 10:01:42 +08:00
xxb 0abe72482c clues update for import not filter repeat 2021-07-22 10:01:42 +08:00
xxb fc7e2109df admin update for receiver clues import and add 2021-07-22 10:01:42 +08:00
dengbw b97d7f23d9 admin_clues_721 2021-07-22 10:01:42 +08:00
dengbw 9e30154f6c admin_items_720_2 2021-07-22 10:01:42 +08:00
lccsw 528e9f04f4 add-wxapp-liche2 2021-07-22 10:01:41 +08:00
dengbw 5fcc6df72a admin_items_720 2021-07-22 10:01:41 +08:00
老叶 670f23907b 修改协议样式
合同样式修改
2021-07-22 10:01:41 +08:00
lccsw 01837ba8b1 add-wxapp-liche 2021-07-22 10:01:41 +08:00
xxb 71d5dfb439 admin update for receiver clues import and add 2021-07-07 14:45:07 +08:00
lccsw f5ab51d3c3 add ignore 2021-07-05 10:09:44 +08:00
5230 changed files with 671485 additions and 1538 deletions
+72
View File
@@ -0,0 +1,72 @@
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
.svn/
# Project-level settings
/.tgitconfig
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
.idea/
./script/qsy/config.php
.sftp-config.json
+16
View File
@@ -0,0 +1,16 @@
<?php
/**
* Created by Vim
* User: lcc
* Desc: 支付宝配置
*/
$config = [
'default' => [
'app_id' => '2021000118631895',
'private_key' => 'MIIEpAIBAAKCAQEAk/KCpSBSJT8Ym6E2q8RhWXj6RHxP0orUOey/5pihXRj0UzQQiiB8pIb5TcB7G8bFSszhgao7DiObYnWUUvUpAGG8tL7aC+Td7JL11PR5Bv1e1HnymCrNWr/LrUAFBpmQ5480/BAX04SZh/RXRrYiM+L5JSRFwiiXaQ2lc9Q1oa+paKe6d19ZiHZ50JN9I9HLPmqchOLK+yIRRPyPoc0TOI7bz1kEW+U76/S+nE8RmSKq+LvDgWzgi4lIt1NXxfSU6z+MAtQHAF6TFeglquGnvFOHU/MkCPQ/+57n31L7DTEGsaLcUZfkipE70nlrYrJgE/jrqQLW4TsRPhJT2bUx4wIDAQABAoIBAHqCCeSqSttE0B+u8xJw3xuzrakgNwjkpLACdzV/lb79dvOe3UNDe3LRwYa8qDRr99rkpKc2Swh+O6DgNB4tm/IQ/K2+i9flgE7xslbQyZccH3ZaNKQEbV+ECihAJuk8KF1WnE1NFi20U13c2phXISNOA3jZ/Fm2Owpmnma3hmGHRbiXImsLhIDFl035Ekt605plriy6yvm6wyvdGGATQsXxDQ0CcOlWdgug7U+vyIc/afRC2kj/afVFqLFyUT2Xo1nTeedwTTSQ/rXRIurdLUVm75SDP1mdoAC+wMd/6LgY7byKPxlSslyaBm73o95feu7sV2dXhDipwThI+p1dQiECgYEA8wwk+l9Cxw5qZPtOXmLMUoqOtkESnZLIaFusm5Z0E1zdZhessVHQmWQ5RsVvYGYvcCG0ujTWNi6sq1fiPeZKnZj+r9Cy8UCQDssS3pV0jvy6ozKZvRMGzugQx3cPrmjwHO3Z6ycrtvz+la/H4VsWwdid8Tx1/KifHJq7XXQ3R/cCgYEAm9TuQOebvBA325rBJZnX6Ats6E9un9j5FRh7/j9CRHFFZmec79NX+306GH1j7WWO0g9nusQKysu9W54S37gIwta9h+46Hxq1bIqctDlL2SpgsZT8ZV8ejQePZwsaEaMh68u1yplPHuUWP4T+LEcH3X1E8l5KQ8Gg/B6aQXKRonUCgYEAqinKifDAFBWnr+OyzqplWzTfDgMpQWFPJqFoi9Yelp/h8mSI5+zcG0jsQPxiKh/g/qTan7P2diDfi2cQYz4k54oCZp27auVE9tZ+84+395RCJ5h5wsLbdWlMthpJxFZ8JgTxGY5nMMqYg7x6OPFJUZaTnh4yjR6Rp7k9jQSc36kCgYA5LQFWEyTS9ehozPk9QJs1aqvE+RAP2l5Z3Sfxe2hnEGB0WGP+or7PaX0dazR08CRc8oYOwstq6SJLMU6fgzjDtGLKMyBkNTqH3rvsbHFl9uSPg6iv0Ry2hiWZmzsvaXmSuKW09ldPcKKfH77apB1AqSvY+bup7KuSle/nP5Ar2QKBgQCbufjQ4I7Iej+KLz8/WVDIWa2to0tkQGxCUoVqxIxRQW8lHhRu5v9Y/gQ6d8dvx7rXb6V0VDf1joPFxnu3FwwMteMpQ8VrbH9vyqktSwCvU5t2dolcpv0MeePz9NPYdmz/MA/YIOmiUt0CVmca4q8WDNtJqjxShoIdbTH9oFXkeQ==',
'appCertPath' => COMMPATH.'third_party/alipaysdk/cert/appCertPublicKey.crt',
'alipayCertPath' => COMMPATH.'third_party/alipaysdk/cert/alipayCertPublicKey.crt',
'rootCertPath' => COMMPATH.'third_party/alipaysdk/cert/alipayRootCert.crt'
]
];
+1 -1
View File
@@ -136,7 +136,7 @@ $config['subclass_prefix'] = 'HD_';
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
$config['composer_autoload'] = COMMPATH.'/vendor/autoload.php';
/*
|--------------------------------------------------------------------------
+17 -17
View File
@@ -1,26 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['bucket'] = 'img-haodian';
$config['region'] = '华';
$config['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['bucket'] = 'img-liche';
$config['region'] = '华';
$config['is_https'] = 'https';
$config['domain'] = 'qimg.haodian.cn';
$config['attch'] = 'hdi/';
$config['domain'] = 'img.liche.cn';
$config['attch'] = 'liche/';
$config['img']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['img']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['img']['bucket'] = 'img-haodian';
$config['img']['region'] = '华';
$config['img']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['img']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['img']['bucket'] = 'img-liche';
$config['img']['region'] = '华';
$config['img']['is_https'] = 'https';
$config['img']['domain'] = 'qimg.haodian.cn';
$config['img']['attch'] = 'hdi/';
$config['img']['domain'] = 'img.liche.cn';
$config['img']['attch'] = 'liche/';
$config['video']['access_key'] = 'f9o5jg_SZQA6IZtru4YZ8eJ-lWfPM6jdTP4lrmTu';
$config['video']['secret_key'] = 'qh76Nn02FjiXXVxF4k6RqVt6keFNfXuVFWaVJAGW';
$config['video']['bucket'] = 'video-haodian';
$config['video']['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['video']['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['video']['bucket'] = 'media-liche';
$config['video']['region'] = '华南';
$config['video']['is_https'] = 'https';
$config['video']['domain'] = 'qv.haodian.cn';
$config['video']['attch'] = 'hdi/';
$config['video']['domain'] = 'media.liche.cn';
$config['video']['attch'] = 'liche/';
+19
View File
@@ -0,0 +1,19 @@
<?php
/**
* Created by Vim
* User: lcc
* Desc: 微信支付配置
* Date: 2021/8/12
* Time: 14:12
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$config['default'] = [ //服务商信息配置
'appid' => 'wxe66f905683582780', //服应用ID
'mchid' => '1612096731', //商户号
'merchantSerialNumber' => '761590F1FF6DFC2466894F96E2DE1169CE644A74', //商户号API证书序列号
'merchantPrivateKey' => '/home/dev28/liche/api/third_party/WXconfig/apiclient_key.pem', //商户私钥路径
'wechatpayCertificate' => '/home/dev28/liche/api/third_party/WXconfig/apiclient_wechatpay.pem', //微信支付平台证书路径
'sub_appid' => 'wx98e64c11aac45966' //子商户应用ID
];
+16
View File
@@ -0,0 +1,16 @@
<?php
/**
* Created by Vim
* User: lcc
* Desc: 晓致小号
* Date: 2021/4/15
* Time: 10:32
*/
$config['app_id'] = 1206;
$config['app_key'] = 'WX6HDVZX3AYSZDR1739332ZM';
$config['mobile_list'] = array(
'13391247942','13391407003','13391416119','13391416302',
'13391416570',
);
+341 -79
View File
@@ -16,6 +16,42 @@ class Common extends CI_Controller
public $data = array();
/**
* Notes:获取车系
* Created on: 2022/3/18 17:09
* Created by: dengbw
* @return bool
*/
public function auto_series()
{
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$brand_id = intval($this->input->post('brand_id'));
$name = $this->input->post('name');
$where['status'] = 1;
$brand_id && $where['brand_id'] = $brand_id;
$name && $where['name like "%' . $name . '%"'] = null;
$list = [];
$count = $this->mdAutoSeries->count($where);
if ($count) {
$list = $this->mdAutoSeries->select($where, "id desc", $page, $size, 'id, name');
}
$this->data['list'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['page'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
//获取素材模版
public function material()
{
$this->load->model('app/material/Material_template_model', 'mdTemplate');
$rows = $this->mdTemplate->select(array('status' => 1, 'type in(1,4)' => null), 'id desc', '', '', 'id,title');
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
//获取行政区域
public function area()
{
@@ -35,7 +71,19 @@ class Common extends CI_Controller
$this->data = $city;
break;
case 'county':
$this->data = $this->area_model->county($id);
$this->data = $this->area_model->county($id, $type);
break;
case 'street':
$this->load->model('sys/sys_street_model', 'mdStreet');
$result = [];
$type == 0 && $result[] = array('name' => '街道/乡镇', 'id' => '');
$list = $this->mdStreet->select(['county_id' => $id], 'id ASC', 0, 0, 'street_id,street_name');
if ($list) {
foreach ($list as $v) {
$result[$v['street_id']] = array('id' => $v['street_id'], 'name' => $v['street_name']);
}
}
$this->data = $result;
break;
default:
$this->data = $this->area_model->province();
@@ -178,7 +226,7 @@ class Common extends CI_Controller
$this->load->model("sys/sys_tag_model");
$rows = $this->sys_tag_model->select($where);
if($rows){
if ($rows) {
foreach ($rows as $v) {
$v['tag_id'] = $v['id'];
$v['tag_name'] = $v['tag_name'];
@@ -204,14 +252,20 @@ class Common extends CI_Controller
$name = $this->input->post('name');
$role_id = $this->input->post('role_id');
$ids = $this->input->post('ids');
$if_mobile = intval($this->input->post('if_mobile'));
$where['status'] = 1;
$name && $where['username like "%' . $name . '%"'] = null;
$role_id && $where['role_id in (' . $role_id . ')'] = null;
$ids && $where['id in (' . $ids . ')'] = null;
$count = $this->mdSysAdmin->count($where);
$list = array();
$list = [];
if ($count) {
$list = $this->mdSysAdmin->select($where, 'id DESC', $page, $size, 'id,username as name');
$select = $if_mobile ? 'id,username,mobile' : 'id,username';
$res = $this->mdSysAdmin->select($where, 'id DESC', $page, $size, $select);
foreach ($res as $key => $value) {
$name = $if_mobile ? $value['username'] . "({$value['mobile']})" : $value['username'];
$list[] = ['id' => $value['id'], 'name' => $name];
}
}
$this->data['commonList'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
@@ -402,8 +456,10 @@ class Common extends CI_Controller
$this->load->model('biz/biz_model', 'mdBiz');
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$type = $this->input->post('type');
$type = intval($this->input->post('type'));
$brand_id = intval($this->input->post('brand_id'));
$city_id = intval($this->input->post('city_id'));
$county_id = intval($this->input->post('county_id'));
$use_shop_list = $this->input->post('use_shop_list');
$sys_cate_id = intval($this->input->post('sys_cate_id'));
@@ -418,14 +474,14 @@ class Common extends CI_Controller
$where['status'] = 1;
$sys_cate_id && $where['cate_id'] = $sys_cate_id;
$biz_name && $where['biz_name like "%' . $biz_name . '%"'] = null;
$brand_id && $where['hd_biz.brand_id'] = $brand_id;
$ids && $where['hd_biz.id not in (' . $ids . ')'] = null;
if ($type == 'jdb') {
$this->load->model('app/jdb/receiver_orders_model', 'mdReceiverOrders');
}
$count = $this->mdBiz->selectBiz($where, '', '', '', 1, $type);
$brand_id && $where['brand_id'] = $brand_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$type && $where['type'] = $type;
$ids && $where['id not in (' . $ids . ')'] = null;
$count = $this->mdBiz->count($where);
if ($count) {
$resBiz = $this->mdBiz->selectBiz($where, 'hd_biz.id desc', $page, $size, 0, $type);
$resBiz = $this->mdBiz->select($where, 'id desc', $page, $size);
foreach ($resBiz as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
@@ -435,13 +491,6 @@ class Common extends CI_Controller
$setValue['sort'] = $key;
$setValue['is_checked'] = $shopChecked[$value['id']] ? 1 : 0;
$setValue['brand_id'] = $value['brand_id'];
if ($type == 'jdb') {
$firstDay = date('Y-m-01', strtotime(date("Y-m-d"))) . ' 00:00:00';
$lastDay = date('Y-m-d', strtotime("$firstDay +1 month -1 day")) . ' 23:59:59';
$setValue['orders_month'] = $this->mdReceiverOrders->count(array("c_time >=" => strtotime($firstDay)
, "c_time <=" => strtotime($lastDay), 'biz_id' => $value['id']));
$setValue['orders'] = $this->mdReceiverOrders->count(array('biz_id' => $value['id']));
}
$shopList[] = $setValue;
}
}
@@ -939,14 +988,7 @@ class Common extends CI_Controller
$this->load->library('hdwechat', $wxconfig);
$result = $this->hdwechat->qrcode($filename, $scene, $page, $width);
if ($result) {
if (false !== strpos($_SERVER['HTTP_HOST'], 'dev')) { //dev 测试
$base_url = 'https://hd-api-dev.xiaoyu.com/';
} elseif (false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试
$base_url = 'https://api.test.haodian.cn/';
} else { // 正式
$base_url = 'https://api.haodian.cn/';
}
$this->data['qrcode'] = $base_url . $result['url'];
$this->data['qrcode'] = http_host_com() . '/' . $result['url'];
}
// $scene = 82;
// $url_params = array('path' => '/' . $page, 'query' => 'id=' . $scene . '&form=auth&_um_campaign=604823e96ee47d382b7a2b79&_um_channel=604823e96ee47d382b7a2b7a',
@@ -1008,42 +1050,26 @@ class Common extends CI_Controller
*/
public function show_sms()
{
$mobile = $this->input->get('mobile');
$type = intval($this->input->get('type'));
$type = $this->input->get('type');
$id = intval($this->input->get('id'));
if (!$id || !$type) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if ($type == 'clues') {
$this->load->model('receiver/receiver_clues_model', 'mdClues');
$re = $this->mdClues->get(array('id' => $id));
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
$mobile = $re['mobile'];
$content = '';
$mobile_edit = 0;
if ($type == 1) {
$mobile_sub = $mobile ? substr_replace($mobile, '****', 3, 4) : '';
} else if ($type == 2) {
$content = '尊敬的合作伙伴您好!我是好店云的客服,已为您分配了一个订单,请及时登录好店云小程序进行处理,感谢您的支持与配合,祝您生活愉快!';
if ($id) {
$this->load->model('app/jdb/receiver_orders_model', 'mdReceiverOrders');
$this->load->model('user/user_biz_model', 'mdUserBiz');
$this->load->model('user/user_model', 'mdUser');
$reOrders = $this->mdReceiverOrders->get(array('id' => $id), 'brand_id,biz_id');
$reUserBiz = array();
if ($reOrders['biz_id']) {
$reUserBiz = $this->mdUserBiz->select(array('biz_id' => $reOrders['biz_id'], 'type' => 1)
, 'id ASC', 0, 0, 'uid');
} else if ($reOrders['brand_id']) {
$reUserBiz = $this->mdUserBiz->select(array('brand_id' => $reOrders['brand_id'], 'type' => 0)
, 'id ASC', 0, 0, 'uid');
}
if ($reUserBiz) {
foreach ($reUserBiz as $key => $value) {
$reUser = $this->mdUser->get(array('uid' => $value['uid'], 'status' => 1), 'mobile');
$reUser['mobile'] && $mobile = $mobile ? $mobile . ',' . $reUser['mobile'] : $reUser['mobile'];
}
}
}
$mobile_sub = $mobile;
$mobile_edit = 1;
} else {
$mobile_sub = $mobile ? substr_replace($mobile, '****', 3, 4) : '';
}
$mobile_sub = $mobile ? substr_replace($mobile, '*****', 0, 5) : '';
$this->data['mobile_sub'] = $mobile_sub;
$this->data['mobile'] = $mobile;
$this->data['mobile_edit'] = $mobile_edit;
$this->data['id'] = $id;
$this->data['type'] = $type;
@@ -1060,13 +1086,20 @@ class Common extends CI_Controller
*/
public function send_sms()
{
$mobile = $this->input->post('mobile');
$content = $this->input->post('content');
$type = intval($this->input->post('type'));
$type = $this->input->post('type');
$id = intval($this->input->post('id'));
if (!$mobile) {
return $this->show_json(SYS_CODE_FAIL, '请输入手机号');
if ($type == 'clues') {
$this->load->model('receiver/receiver_clues_model', 'mdClues');
$re = $this->mdClues->get(array('id' => $id));
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
$mobile = $re['mobile'];
if (!$content) {
return $this->show_json(SYS_CODE_FAIL, '请输入短信内容');
}
@@ -1076,11 +1109,7 @@ class Common extends CI_Controller
if (mb_strlen($content) > 300) {
return $this->show_json(SYS_CODE_FAIL, '短信最多300个字');
}
if ($type == 1) {
$content = '【星盟卡】' . $content;
} else if ($type == 2) {
$content = '【好店云】' . $content;
}
$content = '【狸车】' . $content;
$plaintext = '';
if (strstr($mobile, ',')) { //多个手机号
$mobiles = explode(',', $mobile);
@@ -1097,17 +1126,22 @@ class Common extends CI_Controller
$this->data['content'] = $content;
$this->data['result'] = $plaintext;
if ($plaintext) {
if ($id && $type == 1) {
$this->load->model('app/jdb/receiver_oplogs_model', 'mdReceiverOplogs');
if ($id) {
$data = array(
'rc_id' => $id,
'admin_id' => $this->uid,
'admin_name' => $this->username,
'type' => 2,
'uid' => $this->uid,
'uname' => $this->username,
'type' => 1,
'log' => $content,
'c_time' => time()
);
$this->mdReceiverOplogs->add($data);//增加操作记录
if ($type == 'clues') {
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
$data['clue_id'] = $id;
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
$data['customer_id'] = $id;
}
$this->mdOplogs->add($data);//增加操作记录
}
return $this->show_json(SYS_CODE_SUCCESS, '发送短信成功');
} else {
@@ -1115,6 +1149,80 @@ class Common extends CI_Controller
}
}
/**
* Notes:绑定晓致虚似号手机
* Created on: 2021/7/28 11:17
* Created by: dengbw
* @return bool
*/
public function bind_mobile()
{
$params = $this->input->get();
$id = intval($params['id']);
$type = $params['type'];
if (!$id || !$type) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$this->load->model('receiver/receiver_xz_model', 'mdReceiverXz');
if ($type == 'clues') {
$this->load->model('receiver/receiver_clues_model', 'mdClues');
$re = $this->mdClues->get(array('id' => $id));
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
$mobile = $re['mobile'];
$cache = &load_cache('redis');
$xz_admin_phone = $cache->get('xz_admin_phone');
$middleNumber = '';
if ($xz_admin_phone) {
$middleNumber = $xz_admin_phone['admins'][$this->uid];
}
if (!$middleNumber) {
return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
}
$this->load->helper('order');
$seq_id = create_order_no();
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
$this->config->load('xcall');
$init_config = [
'app_id' => $this->config->item('app_id'),
'app_key' => $this->config->item('app_key'),
];
$xcall = new Xcall($init_config);
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
if ($result['t_code'] == '-26') {//已经绑定解绑
$s_res = $xcall->Searchbind($middleNumber);
$bined_mobile = $s_res['data']['value'];//已绑定手机号
if ($bined_mobile) {
$xcall->SWunbind($bined_mobile, $middleNumber);//解绑
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
}
}
if ($result['code']) {
$this->data['middlenumber'] = $result['data']['virtualMobile'];
$add_data = [
'call_id' => $seq_id,
'display_number' => $result['data']['virtualMobile'],
'cf_id' => $id,
'cf_uid' => $this->uid,
'cf_title' => $type,
'cf_platform' => 'admin',
'c_time' => time()
];
$this->mdReceiverXz->add($add_data);
} else {
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
$this->data['mobile_sub'] = substr_replace($mobile, '*****', 0, 5);
$this->data['id'] = $id;
$this->show_view('common/bind_mobile');
}
/**
* Notes: 获取七牛token
* Created on: 2020/4/16 14:27
@@ -1177,7 +1285,8 @@ class Common extends CI_Controller
* 导入excel表格生成数组
* @return bool
*/
public function excel2arr(){
public function excel2arr()
{
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
$key = $this->input->get('key');
@@ -1201,7 +1310,7 @@ class Common extends CI_Controller
$arr = array();
for ($i = 1; $i <= $rowCnt; $i++) { //读取内容
$row = array();
for($j='A'; $j < $col_max; $j++){
for ($j = 'A'; $j < $col_max; $j++) {
$row[] = $objWorksheet->getCell($j . $i)->getValue();
}
$arr[] = $row;
@@ -1271,11 +1380,11 @@ class Common extends CI_Controller
$where = [];
$status && $where['lc_auto_series.status'] = $status;
$title && $where['lc_auto_series.name like "%' . $title . '%"'] = null;
$count = $this->auto_series_model->select_brand($where,'','','','',1);
$count = $this->auto_series_model->select_brand($where, '', '', '', '', 1);
$itemsList = [];
if ($count) {
$lists = $this->auto_series_model->select_brand($where, 'lc_auto_series.id desc', $page, $size);
foreach($lists as $key=>$val){
foreach ($lists as $key => $val) {
$itemsList[] = [
'id' => $val['id'],
'name' => $val['name'],
@@ -1289,4 +1398,157 @@ class Common extends CI_Controller
$this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:选择品牌
*/
public function brands()
{
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$use_items_list = $this->input->post('use_items_list');
$title = $this->input->post('title');
$status = intval($this->input->post('status'));
$itemsChecked = $itemsList = $resItems = array();
if ($use_items_list) {
foreach ($use_items_list as $key => $value) {
$itemsChecked[$value['id']] = $value['id'];
}
}
$where = [];
$status && $where['status'] = $status;
$title && $where['name like "%' . $title . '%"'] = null;
$count = $this->auto_brand_model->count($where);
$itemsList = [];
if ($count) {
$lists = $this->auto_brand_model->select($where, 'id desc', $page, $size);
foreach ($lists as $key => $val) {
$itemsList[] = [
'id' => $val['id'],
'name' => $val['name'],
'is_checked' => $itemsChecked[$val['id']] ? 1 : 0
];
}
}
$this->data['itemsList'] = $itemsList;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:车型库
* Created on: 2021/7/19 10:18
* Created by: dengbw
* @return bool
*/
public function auto()
{
$type = intval($this->input->get('type'));//1品牌2车系3型号
$pid = intval($this->input->get('pid'));
$name = $this->input->get('name');
$tp = intval($this->input->get('tp'));//0搜索使用,1修改使用
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$res = $lists = array();
if ($type == 1) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
$res = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
} else if ($type == 2) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
$res = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $pid), 'id desc', 0, 0, 'id,name');
} else if ($type == 3) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车型');
$res = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');
}
if ($tp == 1 && $type == 3) {
$lists[3] = $res;//车型
$lists[4] = $this->mdAutoAttr->select(array('type' => 0, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//车身颜色
$lists[5] = $this->mdAutoAttr->select(array('type' => 2, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//内饰颜色
} else {
foreach ($res as $key => $value) {
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
}
}
$this->data = $lists;
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:获取商品列表
*/
public function items()
{
$select_id = $this->input->post('select_id');
$brand_id = $this->input->post('brand_id');
$s_id = $this->input->post('s_id');
$v_id = $this->input->post('v_id');
$cor_id = $this->input->post('cor_id');
$incor_id = $this->input->post('incor_id');
$vin = $this->input->post('vin');
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$where = "status=1 ";
$vin && $where .= ' and vin LIKE "%' . trim($vin) . '%"';
$brand_id && $where .= " and brand_id=$brand_id";
$s_id && $where .= " and s_id=$s_id";
$v_id && $where .= " and v_id=$v_id";
$cor_id && $where .= " and cor_id=$cor_id";
$incor_id && $where .= " and incor_id=$incor_id";
if ($select_id) {
$fhwhere = [
"($where) or (id=$select_id)" => null
];
} else {
$fhwhere = [
"($where)" => null
];
}
$count = 0;
$list = array();
$this->load->model("items/items_model");
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$count = $this->items_model->count($fhwhere);
if ($count) {
$rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin');
//品牌车型
$brand_arr = array_unique(array_column($rows, 'brand_id'));
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
$series_arr = array_unique(array_column($rows, 's_id'));
$series = $this->auto_series_model->get_map_by_ids($series_arr, 'id,name');
//获取属性
$v_arr = array_unique(array_column($rows, 'v_id'));
$cor_arr = array_unique(array_column($rows, 'cor_id'));
$incor_arr = array_unique(array_column($rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$setval = [
'id' => $val['id'],
'vin' => $val['vin']
];
$setval['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$setval['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$setval['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$setval['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$setval['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$list[] = $setval;
}
}
$this->data['list'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['page'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Img extends CI_Controller
{
public function index()
{
$b64_imgs = $this->input->get('imgs');
$arr_imgs = explode(',',base64_decode($b64_imgs));
$lists = [];
if($arr_imgs){
foreach ($arr_imgs as $item) {
$lists[] = [
'alt' => '',
'pid' => '',
'src' => build_qiniu_image_url($item),
'thumb' => build_qiniu_image_url($item)
];
}
}
$data['lists'] = $lists;
$data['_title'] = '大图';
return $this->load->view('img', $data);
}
public function imgs(){
$data = '/liche/0f48c61017285abc0cff63f59ea5a25f.jpg,/liche/be842659e04f9b5b7bf3f9ab1459c611.jpg';
echo base64_encode($data);
}
}
+27 -27
View File
@@ -18,7 +18,7 @@ class Login extends CI_Controller
header('Location:/welcome');
}
$this->load->view('login');
$this->load->view('login_sms');
}
public function post()
@@ -29,38 +29,36 @@ class Login extends CI_Controller
$check_view = false;
$ip = get_client_ip();
$ip_arr = array();
if ($this->input->post('need_code') == 'get') {
return false;
}
$log = 0;//加日志
if ($this->input->post('need_code') == 'login') {
$code = $this->input->post('code');
$mobile = $this->input->post('mobile');
$cookie = $this->input->cookie(LOGIN_CODE_COOKIE);
$code_cookie = $this->encryption->decrypt($cookie);
if (!$code_cookie) {
return $this->show_json(0, '验证码已过期');
return $this->show_json(0, '请输入正确验证码');
}
if ($code_cookie != $code) {
return $this->show_json(0, '验证码错误');
}
$this->load->model('sys/sys_admin_model');
$admin_user = $this->sys_admin_model->get(array("mobile = '{$mobile}'" => null, 'status' => 1));
$admin_user = $this->sys_admin_model->get(array("mobile" => $mobile, 'status' => 1));
if(!$admin_user){
return $this->show_json(0, '用户不存在');
}
$log = 1;
} else {
if (!$username) {
return $this->show_json(0, '请输入用户名/手机号');
}
if (!$password) {
return $this->show_json(0, '请输入密码');
}
$this->load->model('sys/sys_admin_model');
$admin_user = $this->sys_admin_model->get(array("username like '{$username}' OR mobile like '{$username}'" => null, 'status' => 1));
if (!$admin_user['id']) {
return $this->show_json(0, '用户不存在');
} elseif (!$admin_user['status']) {
@@ -68,38 +66,34 @@ class Login extends CI_Controller
} elseif (!password_verify($password, $admin_user['password'])) {
return $this->show_json(0, '密码错误');
} else {
if(false !== strpos($_SERVER['HTTP_HOST'], "hd-admin.dev.xiaoyu.com") || false !== strpos($_SERVER['HTTP_HOST'], "admin.test.haodian.cn")){
//开发测试不校验IP
}elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
if (false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")) {
//开发测试不校验IP
} elseif (filter_var($ip, FILTER_VALIDATE_IP)) {
$this->load->model('sys/sys_config_model');
$config_ip = $this->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL, "k" => "site"));
foreach ($config_ip as $key => $value) {
$ip_arr[] = json_decode($value['v'])->ip;
}
$ip_arr = array_merge($ip_arr, array_column($this->sys_admin_model->select(array(),'','','','login_ip'), 'login_ip'));
$ip_arr = array_merge($ip_arr, array_column($this->sys_admin_model->select(array(), '', '', '', 'login_ip'), 'login_ip'));
if (!in_array($ip, $ip_arr)) {
$check_view = true;
$log = 1;
}
}
}
}
$admin_info = array(
'id' => $admin_user['id'],
'username' => $admin_user['username'],
'role_id' => $admin_user['role_id'],
'login_ip' => $ip,
);
$http_host = explode(':',$_SERVER['HTTP_HOST']);
$http_host = explode(':', $_SERVER['HTTP_HOST']);
$domain = explode('.', $http_host[0]);
array_shift($domain);
$domain = implode('.', $domain);
$this->input->set_cookie(LOGIN_COOKIE, $this->encryption->encrypt(json_encode($admin_info)), 86400 * 30, $domain);
if ($check_view) {
if ($log == 1) {
$this->load->model('sys/sys_admin_log_model');
$log = array(
'admin_id' => $admin_user['id'],
@@ -111,13 +105,11 @@ class Login extends CI_Controller
'jsondata' => json_encode($this->input->post(), JSON_UNESCAPED_UNICODE),
);
$this->sys_admin_log_model->add($log);
}
if ($check_view && $admin_user['id'] > 10) {//管理员id>10去掉验证码登录
return $this->show_json(SYS_CODE_SUCCESS, '访问IP发生变化,需要手机验证登录', '/login/check_view');
} else {
$this->sys_admin_model->update(array('login_ip' => $ip), array('id' => $admin_user['id']));
return $this->show_json(SYS_CODE_SUCCESS, ' 登 录 成 功', '/');
}
}
@@ -127,6 +119,11 @@ class Login extends CI_Controller
{
if ($this->input->method() == 'post') {
$mobile = $this->input->post('mobile', true);
$this->load->model('sys/sys_admin_model');
$admin_user = $this->sys_admin_model->get(array("mobile" => $mobile, 'status' => 1));
if(!$admin_user){
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
}
$code = rand(100000, 999999);
$domain = explode('.', $_SERVER['HTTP_HOST']);
@@ -134,7 +131,10 @@ class Login extends CI_Controller
$domain = implode('.', $domain);
$this->input->set_cookie(LOGIN_CODE_COOKIE, $this->encryption->encrypt(json_encode($code)), 60 * 5, $domain);
send_sms($mobile, array($code));
// send_sms($mobile, $code);
$content = "【东创宝】您的验证码为:{$code},请勿泄露于他人!";
b2m_send_sms($mobile,$content);
return $this->show_json(SYS_CODE_SUCCESS, '验证码已发送');
}
}
@@ -214,7 +214,7 @@ class Login extends CI_Controller
array_shift($domain);
$domain = implode('.', $domain);
$this->input->set_cookie(LOGIN_COOKIE, '', 0 ,$domain);
$this->input->set_cookie(LOGIN_COOKIE, '', 0, $domain);
return $this->show_json(SYS_CODE_SUCCESS, '注销成功', '/login');
}
+51 -2
View File
@@ -23,6 +23,10 @@ class Upload extends CI_Controller
$mark = $this->input->get('mark');
$source = $this->input->get('source');
if('file' == $mark){
return $this->pdf();
}
$data['mode'] = $mode ? $mode : '1';
$data['types'] = $types ? $types : 'jpg,png';
$data['uptype'] = $uptype ? $uptype : 'qiniu';
@@ -35,7 +39,23 @@ class Upload extends CI_Controller
$data['mark_id'] = $mark_data[1];
$data['mark_url'] = count($mark_data) >= 3 ? $mark_data[2] : '/biz/store/pic/add';
}
$this->load->view('upload', $data);
return $this->load->view('upload', $data);
}
public function pdf(){
$mode = $this->input->get('mode');
$types = $this->input->get('type');
$uptype = $this->input->get('uptype');
$source = $this->input->get('source');
$field = $this->input->get('field');
$data['mode'] = $mode ? $mode : '1';
$data['types'] = $types;
$data['uptype'] = $uptype ? $uptype : 'qiniu';
$data['mimes'] = $this->file_mime($data['types']);
$data['source'] = $source ? $source : '';
$data['field'] = $field ? $field : '';
$this->load->view('uploadpdf', $data);
}
//文件状态检查
@@ -74,6 +94,35 @@ class Upload extends CI_Controller
return $this->show_json('NOT_FOUND', $config);
}
//文件状态检查
public function upstate_pdf()
{
$post = $this->input->post();
$this->load->library('qiniu');
$config = $this->qiniu->getConfig();
$filename = join('/', str_split($post['md5'], 16)) . '.' . strtolower(pathinfo($post['filename'], PATHINFO_EXTENSION));
$filename = $config['attch'] . date('Y/m') . '/' . $filename;
// 检查文件是否已上传
if ($site_url = $this->qiniu->getFileUrl($filename)) {
return $this->show_json('IS_FOUND', array(
'site_url' => $site_url,
'file_url' => $filename,
'file_title' => substr($filename, strrpos($filename, '/')+1)
));
}
// 需要上传文件,生成上传配置参数
$config = array('uptype' => $post['uptype'], 'file_url' => $filename);
$config['server'] = $this->qiniu->getUploadQiniuUrl(true);
$config['token'] = $this->qiniu->getToken($filename);
$config['file_title'] = substr($filename, strrpos($filename, '/')+1);
return $this->show_json('NOT_FOUND', $config);
}
//返回json数据
protected function show_json($code = '', $data = array())
{
@@ -98,4 +147,4 @@ class Upload extends CI_Controller
return join(',', array_unique($mime));
}
}
}
+17 -3
View File
@@ -33,11 +33,13 @@ class App extends HD_Controller
$total = $this->app_model->count($where);
$lists = array();
if($total){
$rows = $this->app_model->select($where, 'id DESC', $page, $size, 'id,name,c_time');
$rows = $this->app_model->select($where, 'id DESC', $page, $size, 'id,name,jsondata,c_time');
foreach($rows as $item){
$jsondata = json_decode($item['jsondata'],true);
$lists[] = array(
'id' => $item['id'],
'name' => $item['name'],
'publish' => $jsondata['publish'] ? 1 : 0,
'c_time' => date('Y-m-d H:i', $item['c_time']),
);
}
@@ -307,5 +309,17 @@ class App extends HD_Controller
{
// TODO: Implement export() method.
}
}
public function edit_publish(){
$id = $this->input->post('id');
$value = $this->input->post('value');
$row = $this->app_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$jsondata = json_decode($row['jsondata'],true);
$jsondata['publish'] = $value ? 1:0;
$jsondata = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$this->app_model->update(['jsondata'=>$jsondata],['id'=>$id]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
}
+87
View File
@@ -0,0 +1,87 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: lcc
* Date: 2021/09/02
* Time: 17:45
*/
require_once COMMPATH.'libraries/WechatPayV3.php';
class Profinish extends HD_Controller
{
private $log_file = 'profinish.log';
function __construct()
{
parent::__construct();
}
public function index()
{
$this->data['log_file'] = $this->log_file;
$this->data['_title'] = '结束分账';
return $this->show_view('app/profinish',true);
}
public function lists()
{
}
public function get()
{
}
public function add()
{
}
public function edit()
{
$sub_mchid = $this->input->post('sub_mchid');
$transaction_id = $this->input->post('transaction_id');
$description = $this->input->post('description');
if(!$transaction_id || !$description || !$sub_mchid){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->load->helper('order');
$out_order_no = create_order_no();
$this->config->load('wxpay');
$wx_config = $this->config->item('default');
$params = [
'merchantId' => $wx_config['mchid'],
'merchantSerialNumber' => $wx_config['merchantSerialNumber'],
'merchantPrivateKey' => $wx_config['merchantPrivateKey'],
'wechatpayCertificate' => $wx_config['wechatpayCertificate'],
];
$WechatPayV3 = new WechatPayV3($params);
$json = [
'sub_mchid' => $sub_mchid,
'transaction_id' => $transaction_id,
'out_order_no' => $out_order_no,
'description' => $description,
];
$noncestr = getNonceStr(20);
$resq = $WechatPayV3->unfreeze($json,$noncestr);
debug_log("[结束分账返回参数]:" .json_encode($resq,JSON_UNESCAPED_UNICODE), $this->log_file,'wxapi');
if(!$resq['code']){
return $this->show_json(SYS_CODE_FAIL, $resq['msg']);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function del()
{
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
}
+3 -99
View File
@@ -10,7 +10,6 @@ class Config extends Appconf
parent::__construct();
$this->load->model('app/app_model');
$this->load->model("app/appusual/app_config_model");
$this->load->model('vipcard/Vipcard_rights_model', 'rightsM');
}
//首页信息
@@ -29,8 +28,6 @@ class Config extends Appconf
public function get()
{
$id = $this->input->get('app_id');
$this->load->model('app/app_model');
$this->load->model("sys/sys_city_model", 'city_model');
$app = $this->app_model->get(array('id' => $id));
if (!$app) {
@@ -39,23 +36,6 @@ class Config extends Appconf
$json = $app['jsondata'] ? json_decode($app['jsondata'], true) : array();
$json['id'] = $id;
$json['name'] = $app['name'];
$where = array('status' => 1);
$total = $this->city_model->count($where);
$citys = array();
if ($total) {
$rows = $this->city_model->select($where, 'id DESC', 1, 20, 'city_id,name,firstchar');
foreach ($rows as $item) {
$status = intval($json['citys'][$item['city_id']]);
$citys[] = array(
'city_id' => $item['city_id'],
'firstchar' => $item['firstchar'],
'name' => $item['name'],
'status' => $status,
'statusion' => $status ? '开启' : '关闭',
'default_city_id' => $json['city_id'] == $item['city_id'] ? 1 : 0,
);
}
}
$where = array('app_id' => $id);
$select = "k,v";
@@ -68,11 +48,8 @@ class Config extends Appconf
}
$json[$k] = $v;
}
$this->data['type_arr'] = self::$rights_type;
$this->data['coup_arr'] = self::$coupon_type;
$this->data['info'] = $json;
$this->data['citys'] = $citys;
$this->data['_title'] = "{$app['name']}-基础设置";
return $this->show_view('/app/appusual/get_config', true);
}
@@ -83,47 +60,6 @@ class Config extends Appconf
}
public function edit_city()
{
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->post('id');
$city = $this->input->post('city');
$status = $this->input->post('status');
$type = $this->input->post('type');
$this->load->model('app/app_model');
$app = $this->app_model->get(array('id' => $id));
if (!$app) {
return $this->show_json(SYS_CODE_FAIL, "id为{$id}小程序不存在");
}
$json = $app['jsondata'] ? json_decode($app['jsondata'], true) : array();
if ($type == 1) {
if ($status) {
$json['city_id'] = $city;
} else {
$json['city_id'] = 0;
}
} else {
if ($status) {
!$json['citys'][$city] && $json['citys'][$city] = 1;
} else {
unset($json['citys'][$city]);
if (!$json['citys']) {
unset($json['citys']);
}
}
}
$ret = $this->app_model->update(array('jsondata' => json_encode($json)), array('id' => $id));
if (!$ret) {
debug_log("[error]" . __FUNCTION__ . ":" . $this->app_model->db->last_query(), $this->log_file);
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//编辑单条数据
public function edit()
@@ -138,18 +74,9 @@ class Config extends Appconf
}
$json = json_decode($app['jsondata'], true);
//是否开启自定义店铺分类
$json_k = array('biz_cate', 'vipcard', 'rights', 'coupons', 'ebiz', 'publish', 'lock_fans', "rpackets");
$json_k = array('publish');
foreach ($json_k as $k) {
switch($k){
case 'rights':
case 'coupons':
case 'rpackets':
if($input[$k] && is_array($input[$k])){
$json[$k] = $input[$k];
} else {
unset($json[$k]);
}
break;
default:
if ($input[$k]) {
$json[$k] = $input[$k];
@@ -160,29 +87,6 @@ class Config extends Appconf
}
$this->app_model->update(array('jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE)), array('id' => $input['id']));
$config_k = array('hotword');
foreach($config_k as $k){
$where = array('app_id' => $input['id'], 'k' => $k);
$row_config = $this->app_config_model->get($where);
if($input[$k]){
if($row_config){
$upd = array("v" => json_encode($input[$k], JSON_UNESCAPED_UNICODE));
$ret = $this->app_config_model->update($upd, array('id' => $row_config['id']));
} else {
$add = array(
'app_id' => $input['id'],
'k' => $k,
'v' => json_encode($input[$k], JSON_UNESCAPED_UNICODE),
'admin_id' => $this->uid,
'c_time' => time()
);
$ret = $this->app_config_model->add($add);
}
} elseif($row_config) {
$ret = $this->app_config_model->delete(array('id' => $row_config['id']));
}
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
@@ -203,4 +107,4 @@ class Config extends Appconf
{
}
}
}
+107
View File
@@ -0,0 +1,107 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once(dirname(__DIR__).'/Appconf.php');
/**
* 为app用户披上马甲以在小程序里查看其他用户信息,方便线上测试
* Created by PhpStorm.
* User: xuxb
* Date: 2020/4/29
* Time: 15:40
*/
class Umajia extends Appconf{
public function index(){
// TODO: Implement index() method.
}
public function lists(){
// TODO: Implement lists() method.
}
public function get(){
$uid = intval($this->input->get('uid'));
$row = $this->u_entity->get(array('id'=>$uid));
$info = array(
'uid' => $row['id'],
'nickname' => $row['nickname'],
'mobile' => $row['mobile'],
);
$majia = array();
$title ='披上马甲';
if($row['jsondata']){
$json = json_decode($row['jsondata'], true);
$majia_uid = $json['majia']['uid'];
if($majia_uid){
$row = $this->u_entity->get(array('id'=>$majia_uid));
if($row){
$majia = array(
'uid' => $row['id'],
'nickname' => $row['nickname'],
'mobile' => $row['mobile'],
);
$title ='编辑马甲';
}
}
}
$info['majia'] = $majia;
$this->data['info'] = $info;
$this->data['_title'] = $title;
$this->show_view('app/appusual/umajia/get', true);
}
public function add(){
// TODO: Implement add() method.
}
public function edit(){
$info = $this->input->post('info');
$uid = $info['uid'];
$user = $this->u_entity->get(array('id'=>$uid));
$json = $user['jsondata'] ? json_decode($user['jsondata'], true) : array();
if($info['majia']){
$json['majia'] = array('uid' => $info['majia']['uid']);
} else {
unset($json['majia']);
}
$upd = array(
'jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE)
);
$this->u_entity->update($upd, array('id' => $uid));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
public function del(){
$uid = $this->input->post('uid');
$user = $this->u_entity->get(array('id' => $uid));
$json = $user['jsondata'] ? json_decode($user['jsondata'], true) : array();
unset($json['majia']);
$upd = array(
'jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE)
);
$this->u_entity->update($upd, array('id' => $uid));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
}
+255
View File
@@ -0,0 +1,255 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Member extends HD_Controller
{
private $where, $appConfig;
private $wxqyAry = array(0 => '未加', 1 => '加入', -1 => '删除');
private $ifkzAry = array(0 => '未开', 1 => '已开');
private $levelNameAry = array(13 => "状元插金花", 12 => "六勃红", 11 => "遍地锦", 10 => "六抔黑", 9 => "五红", 8 => "五子带一秀",
7 => "五子", 6 => "状元", 5 => "对堂", 4 => "三红", 3 => "四进", 2 => "二举", 1 => "一秀", 0 => "罚黑");
private $carGoldAry = array(1 => '博饼500', 2 => '企微500', 3 => '排名1000');
public function __construct()
{
parent::__construct();
$this->load->model('bobing/bobing_user_model', 'mdBobingUser');
$this->load->model('bobing/bobing_user_credit_model', 'mdBobingUserCredit');
$this->load->model('bobing/bobing_logs_model', 'mdBobingLogs');
$this->appConfig = $this->mdBobingUser->appConfig();
$this->where = array('act_key' => $this->appConfig['act_key'], 'app_id' => $this->appConfig['app_id']);
$this->load->service("app/user_service", array("app_id" => $this->appConfig['app_id']));
}
//首页信息
public function index()
{
$this->lists();
}
//数据列表
public function lists()
{
$menuAry = array(array('id' => 1, 'title' => "红包发放总金额", 'value' => 0, 'tag' => '元')
, array('id' => 2, 'title' => "今天红包发放金额", 'value' => 0, 'tag' => '元')
, array('id' => 3, 'title' => "购车金发放总金额", 'value' => 0, 'tag' => '元')
, array('id' => 4, 'title' => "今天购车金发放金额", 'value' => 0, 'tag' => '元'));
$date = date('Y-m-d');
foreach ($menuAry as $key => $value) {
$sum = 0;
if ($value['id'] == 1) {
$hong_bao_day = $this->mdBobingLogs->sum('hong_bao', array_merge($this->where, array('status' => 2)));
$sum = $hong_bao_day['hong_bao'];
} else if ($value['id'] == 2) {
$hong_bao_day = $this->mdBobingLogs->sum('hong_bao', array_merge($this->where, array('bo_date' => $date, 'status' => 2)));
$sum = $hong_bao_day['hong_bao'];
} else if ($value['id'] == 3) {
$car_gold = $this->mdBobingUser->sum('car_gold', $this->where);
$buy_car_gold = $this->mdBobingUser->sum('buy_car_gold', $this->where);
$lotter_gold = $this->mdBobingUser->sum('lotter_gold', $this->where);
$sum = $car_gold['car_gold'] + $buy_car_gold['buy_car_gold'] + $lotter_gold['lotter_gold'];
} else if ($value['id'] == 4) {
$car_gold = $this->mdBobingLogs->sum('car_gold', array_merge($this->where, array('bo_date' => $date)));
$sum = $car_gold['car_gold'];
}
$menuAry[$key]['value'] = $sum ? $sum : 0;
}
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = $where = array();
if ($params['name'] || $params['mobile']) {
$where_u = array();
if ($params['name']) {
$where_u = array("nickname LIKE '%{$params['name']}%'" => null);
}
if ($params['mobile']) {
$where_u = array("mobile LIKE '%{$params['mobile']}%'" => null);
}
$res_u = $this->user_service->select($where_u, 'id DESC', 0, 0, 'id');
$uids = array_column($res_u, 'id');
!$uids && $uids[] = 0;
$where['uid in (' . implode(',', $uids) . ')'] = null;
}
if (status_verify($params['wxqy'])) {
$where['wxqy'] = $params['wxqy'];
} else {
$params['wxqy'] = -99;
}
if (status_verify($params['if_kz'])) {
$where['if_kz'] = $params['if_kz'];
} else {
$params['if_kz'] = -99;
}
if ($params['car_gold']) {
if ($params['car_gold'] == 1) {
$where['car_gold>='] = 500;
} elseif ($params['car_gold'] == 2) {
$where['buy_car_gold>='] = 500;
} elseif ($params['car_gold'] == 3) {
$where['lotter_gold>='] = 1000;
}
}
$params['credit_sort'] = $params['credit_sort'] ? intval($params['credit_sort']) : -1;
if ($params['credit_sort'] > -1) {
$order = $params['credit_sort'] == 1 ? "credit desc" : 'credit asc';
} else {
$order = "id desc";
}
$count = $this->mdBobingUser->count(array_merge($this->where, $where));
if ($count) {
$res = $this->mdBobingUser->select(array_merge($this->where, $where), $order, $params['page'], $params['size']);
$uids = array_column($res, 'uid');
$res_u = $this->user_service->select(array('id in (' . implode(',', $uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname,mobile');
foreach ($res_u as $key => $value) {
$users[$value['id']] = array('nickname' => $value['nickname'], 'mobile' => $value['mobile']);
}
foreach ($res as $key => $value) {
$setValue = array();
$user = $users[$value['uid']];
$setValue['uid'] = $value['uid'];
$setValue['nickname'] = $user['nickname'];
$setValue['mobile'] = $user['mobile'];
$setValue['credit'] = $value['credit'];
$car_gold = $value['car_gold'] + $value['buy_car_gold'] + $value['lotter_gold'];
$car_gold = $value['car_gold'] . '+' . $value['buy_car_gold'] . '+' . $value['lotter_gold']
. '=<strong class="text-danger mr10">' . $car_gold . '</strong>';
$setValue['car_gold'] = $car_gold;
$setValue['if_kz'] = $this->ifkzAry[$value['if_kz']];
$setValue['wxqy'] = $this->wxqyAry[$value['wxqy']];
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['menuAry'] = $menuAry;
$this->data['wxqyAry'] = $this->wxqyAry;
$this->data['ifkzAry'] = $this->ifkzAry;
$this->data['carGoldAry'] = $this->carGoldAry;
$this->data['_title'] = '博饼用户';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/bobing/member/lists', true);
}
//博饼记录
public
function lists_logs()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$uid = intval($params['uid']);
$res_u = $this->user_service->get(array('id' => $uid));
$nickname = $res_u['nickname'] ? $res_u['nickname'] : '未授权';
$lists = $users = array();
$where = array('uid' => $uid);
if ($params['bo_date']) {
$bo_date = explode(' ~ ', $params['bo_date']);
$bo_date[0] && $where["bo_date >="] = $bo_date[0];
$bo_date[1] && $where["bo_date <="] = $bo_date[1];
}
$count = $this->mdBobingLogs->count(array_merge($this->where, $where));
if ($count) {
$res = $this->mdBobingLogs->select(array_merge($this->where, $where), 'id desc', $params['page'], $params['size']);
$cfusers = array();//微信昵称
$cf_uids = array_unique(array_column($res, 'cf_uid'));
$re_u = $this->user_service->select(array('id in (' . implode(',', $cf_uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname');
foreach ($re_u as $key => $value) {
$cfusers[$value['id']] = $value['nickname'] ? $value['nickname'] : '未授权';
}
foreach ($res as $key => $value) {
$setValue = array();
$setValue['dices'] = $value['dices'];
$setValue['level_name'] = $value['type'] != 2 ? $this->levelNameAry[$value['level']] : '';
$setValue['credit'] = $value['credit'];
$setValue['car_gold'] = $value['car_gold'] > 0 ? $value['car_gold'] : '';
$setValue['hong_bao'] = $value['hong_bao'] > 0 ? $value['hong_bao'] . ($value['status'] == 2 ? '已领' : '未领') : '';
$setValue['bo_date'] = $value['bo_date'];
if ($value['type'] == 1) {
$type_name = $cfusers[$value['cf_uid']] . '帮博';
} else if ($value['type'] == 2) {
$type_name = '加企微';
} else {
$type_name = '个人博';
}
$setValue['type_name'] = $type_name;
$setValue['c_time'] = $value["c_time"] ? date('Y-m-d H:i:s', $value["c_time"]) : '';
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = $nickname . '_博饼记录';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/bobing/member/lists_logs', true);
}
public
function lists_day()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$uid = intval($params['uid']);
$res_u = $this->user_service->get(array('id' => $uid));
$nickname = $res_u['nickname'] ? $res_u['nickname'] : '未授权';
$lists = $users = array();
$where = array('uid' => $uid);
$count = $this->mdBobingUserCredit->count(array_merge($this->where, $where));
if ($count) {
$res = $this->mdBobingUserCredit->select(array_merge($this->where, $where), 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['bo_date'] = $value['bo_date'];
$setValue['credit'] = $value['credit'];
$setValue['lottery'] = $value['lottery'] == 1 ? '中奖' : '未中奖';
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = $nickname . '_每日博饼';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/bobing/member/lists_day', true);
}
//展示单条数据
public
function get()
{
}
//添加单条数据
public
function add()
{
}
//编辑单条数据
public
function edit()
{
}
//删除单条数据
public
function del()
{
}
//批量操作(默认修改状态)
public
function batch()
{
}
//导出数据列表
public
function export()
{
}
}
+123
View File
@@ -0,0 +1,123 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim.
* User: lcc
* Date: 2021/10/15
* Time: 10:02
*/
class Cash extends HD_Controller{
protected $status_arr = [0=>'提现中',1=>'提现成功',-1=>'提现失败'];
public function __construct()
{
$this->app_id = 1;
parent::__construct();
$this->load->model('app/user_accountlog_model');
$this->load->model('app/liche/App_liche_users_model', 'user_model');
}
public function index(){
}
public function lists(){
$params = $this->input->get();
$page = $params['page'];
$size = $params['size'];
!$page && $page = 1;
!$size && $size = 20;
$t1 = 'lc_app_user_accountlog';
$t2 = 'lc_app_user_account';
$where = [
"$t1.trade_type" => 2,
"$t2.app_id" => $this->app_id
];
strlen($params['status']) && $where["$t1.status"] = $params['status'];
$count = $this->user_accountlog_model->count_log($where);
$lists = [];
if($count){
$fileds = "$t1.id,$t1.money_out,$t1.status,$t1.jsondata,$t1.c_time,$t2.app_uid";
$rows = $this->user_accountlog_model->select_log($where,"$t1.id desc",$page,$size,$fileds);
$user_ids = array_column($rows,'app_uid');
$user_rows = $this->user_model->get_map_by_ids($user_ids,'id,nickname');
foreach($rows as $key=>$val){
$jsondata = json_decode($val['jsondata'],true);
$lists[] = [
'id' => $val['id'],
'nickname' => $user_rows[$val['app_uid']][0]['nickname'],
'money' => $val['money_out'],
'status' => $val['status'],
'ali_name' => $jsondata['name'],
'ali_account' => $jsondata['account'],
'status_cn' => $this->status_arr[$val['status']],
'jsondata' => $val['jsondata'],
'c_time' => date("Y-m-d H:i:s",$val['c_time'])
];
}
}
$this->data['params'] = $params;
$this->data['status_arr'] = $this->status_arr;
$this->data['lists'] = $lists;
$this->data['_title'] = '提现列表';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
return $this->show_view('/app/liche/cash/lists', true);
}
public function get(){
}
public function add(){
}
public function edit(){
$id = $this->input->post('id');
$row = $this->user_accountlog_model->get(['id'=>$id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if($row['status']){
return $this->show_json(SYS_CODE_FAIL, '已提现');
}
$jsondata = json_decode($row['jsondata'],true);
require_once COMMPATH.'third_party/alipaysdk/Alipay.php';
$alipay = new Alipay();
$sid = time();
$amount = $row['money_out'];
$account = $jsondata['account'];
$name = $jsondata['name'];
$result = $alipay -> transfer($sid,$amount,$account,$name);
if(!$result['code']){
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
$jsondata['out_biz_no'] = $result['data']['out_biz_no'];
$jsondata['order_id'] = $result['data']['order_id'];
$jsondata['pay_fund_order_id'] = $result['data']['pay_fund_order_id'];
$jsondata['status'] = $result['data']['status'];
$up_data = [
'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE),
'status' => 1
];
$this->user_accountlog_model->update($up_data,['id'=>$row['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function del()
{
// TODO: Implement del() method.
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
}
+77 -13
View File
@@ -10,16 +10,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Cms extends HD_Controller
{
private $log_dir;
static $pos_arr = array(
'首页bannber','热门活动','购车banner'
);
private $pos_arr;
public function __construct()
{
parent::__construct();
$this->load->model('app/liche/App_liche_cms_model', 'liche_cms_model');
$this->load->model('app/App_model', 'appM');
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
$this->pos_arr = $this->liche_cms_model->get_position(true);
}
public function index()
@@ -47,10 +46,10 @@ class Cms extends HD_Controller
foreach ($lists as $key => $value) {
$lists[$key]['s_time'] = date('Y-m-d H:i:s', $value['s_time']);
$lists[$key]['e_time'] = date('Y-m-d H:i:s', $value['e_time']);
$lists[$key]['position'] = self::$pos_arr[$value['position']];
$lists[$key]['position_name'] = $this->pos_arr[$value['position']];
}
$count = $this->liche_cms_model->count($where);
$this->data['pos_arr'] = self::$pos_arr;
$this->data['pos_arr'] = $this->pos_arr;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count, 'total' => $count);
$this->data['_title'] = $this->title . '列表';
@@ -62,13 +61,30 @@ class Cms extends HD_Controller
$id = $this->input->get('id');
if($id){
$row = $this->liche_cms_model->get(array('id' => $id));
$json = json_decode($row['jsondata'],true);
$arr = $row['cover'] ? explode(',', $row['cover']) : array();
$covers = array();
foreach($arr as $val){
$covers[] = build_qiniu_image_url($val);
}
$row['btn_type'] = $json['btn_type'] ? $json['btn_type'] : 1;
$row['bg_img'] = $json['bg_img'] ? $json['bg_img'] : '';
$row['bg_img_src'] = $json['bg_img'] ? build_qiniu_image_url($json['bg_img']) : '';
$row['qrcode'] = $json['qrcode'];
$cfrom_id2 = $cfrom_id = 0;
if($json['cfrom_id']){
$c_row = $this->clues_cfrom_model->get(['id'=>$json['cfrom_id']],'id,pid');
if($c_row['pid']){
$f_row = $this->clues_cfrom_model->get(['id'=>$c_row['pid']],'id');
$cfrom_id = $f_row['id'];
$cfrom_id2 = $c_row['id'];
}else{
$cfrom_id = $json['cfrom_id'];
}
}
$row['cfrom_id'] = $cfrom_id;
$row['cfrom_id2'] = $cfrom_id2;
$row['link'] = $row['url'];
$row['s_time'] = date('Y-m-d H:i:s', $row['s_time']);
$row['e_time'] = date('Y-m-d H:i:s', $row['e_time']);
@@ -76,15 +92,16 @@ class Cms extends HD_Controller
$title = "编辑{$row['title']}";
} else {
$row = array('position' => '', 'type' => 1);
$row = array('position' => '', 'type' => 1,'btn_type'=>1,'cfrom_id' => 0,'cfrom_id2'=>0);
$opration = 'add';
$title = '添加推送信息';
$covers = array();
}
//列表
$this->data['cfroms'] = $this->clues_cfrom_model->select(['status'=>1,'pid'=>0],'id desc','','','id,title');
$this->data['app_id'] = 3;
$this->data['info'] = $row;
$this->data['pos_arr'] = self::$pos_arr;
$this->data['pos_arr'] = $this->pos_arr;
$this->data['covers'] = $covers;
$this->data['url'] = $opration;
$this->data['_title'] = $title;
@@ -120,6 +137,11 @@ class Cms extends HD_Controller
];
$json = array();
$input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id'];
$input['cfrom_id2'] && $json['cfrom_id'] = $input['cfrom_id2'];
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
$input['qrcode'] && $json['qrcode'] = $input['qrcode'];
if($json){
$insert['jsondata'] = json_encode($json, JSON_UNESCAPED_UNICODE);
}
@@ -134,6 +156,8 @@ class Cms extends HD_Controller
public function edit()
{
$input = $this->input->post('info');
$row = $this->liche_cms_model->get(['id'=>$input['id']]);
$json = json_decode($row['jsondata'],true);
if (empty($input['title'])) {
return $this->show_json(SYS_CODE_FAIL, '标题不能为空!');
}
@@ -146,6 +170,11 @@ class Cms extends HD_Controller
$cover = !empty($input['cover']) ? str_replace('https://qimg.haodian.cn/', '', $input['cover']) : $input['cover'];
$input['link'] = $input['link'] . trim($input['param']);
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
$input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id'];
$input['cfrom_id2'] && $json['cfrom_id'] = $input['cfrom_id2'];
$input['qrcode'] && $json['qrcode'] = $input['qrcode'];
$upd = [
'title' => $input['title'] ? $input['title'] : '',
'url' => $input['link'] ? $input['link'] : '',
@@ -157,6 +186,7 @@ class Cms extends HD_Controller
's_time' => strtotime($input['s_time']),
'e_time' => strtotime($input['e_time']),
'sort' => intval($input['sort']),
'jsondata' => json_encode($json,JSON_UNESCAPED_UNICODE)
];
$this->liche_cms_model->update($upd, ['id' => $input['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '修改成功!');
@@ -189,14 +219,48 @@ class Cms extends HD_Controller
public function get_car(){
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$id = $this->input->post('id');
$row = $this->auto_series_model->get(['id'=>$id]);
$b_row = $this->auto_brand_model->get(['id'=>$row['brand_id']]);
$row = $this->auto_brand_model->get(['id'=>$id]);
$info['id'] = $row['id'];
$info['title'] = $b_row['name'].$row['name'];
$info['title'] = $row['name'];
$info['img'] = '/img/visits/add.jpg';
$this->data['data'] = $info;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function get_cfroms(){
$id = $this->input->get('id');
$rows = $this->clues_cfrom_model->select(['pid'=>$id,'status'=>1],'id desc','','','id,title');
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
//群码二维码
public function get_share_link(){
$app_id = 1;
$this->load->model('app/app_model', 'mdApp');
$id = $this->input->get('id');
$cms = $this->liche_cms_model->get(['id'=>$id]);
if(!$cms){
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$wxconfig = $this->mdApp->appConfig()[$app_id]['wx'];
$openlink = '';
$page = $this->mdApp->appConfig()[$app_id]['wx']['pages_groupcode_detail'];
$scene = $id;
$width = '850px';
$path = "{$page}?id={$scene}";
$width && $path .= "{$width}";
$filename = "{$this->mdApp->appConfig()[$app_id]['app_key']}/" . substr(md5($path), 8, 16);
$this->load->library('hdwechat', $wxconfig);
$result = $this->hdwechat->qrcode($filename, $scene, $page, $width);
if ($result) {
$base_url = http_host_com('api');
$this->data['qrcode'] = $base_url.'/'. $result['url'];
}
$this->data['page'] = $page . '?' . $scene;
$this->data['openlink'] = $openlink;
return $this->show_view('common/share_link');
}
}
+161
View File
@@ -0,0 +1,161 @@
<?php
/**
* Notes:福袋活动
* Created on: 2021/11/25 15:16
* Created by: dengbw
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Luckybag extends HD_Controller
{
private $giftBagAry = array(0 => '未领取', 1 => '已领取');
public function __construct()
{
parent::__construct();
$this->load->model('app/liche/app_liche_luckybag_users_model', 'mdLuckyBagUsers');
$this->load->model('app/liche/app_liche_luckybag_log_model', 'mdLuckyBagLog');
$this->load->service("app/user_service", array("app_id" => 1));
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = $where = [];
if ($params['name']) {
$where["uid in (select id from lc_app_liche_users where nickname like '%{$params['name']}%')"] = null;
}
if ($params['mobile']) {
$where["uid in (select id from lc_app_liche_users where mobile like '%{$params['mobile']}%')"] = null;
}
if (status_verify($params['lottery'])) {
$where['lottery'] = $params['lottery'];
} else {
$params['lottery'] = '-99';
}
if (status_verify($params['gift_bag'])) {
$where['gift_bag'] = $params['gift_bag'];
} else {
$params['gift_bag'] = '-99';
}
$count = $this->mdLuckyBagUsers->count($where);
if ($count) {
$res = $this->mdLuckyBagUsers->select($where, 'id desc', $params['page'], $params['size']);
$uids = array_column($res, 'uid');
$res_u = $this->user_service->select(array('id in (' . implode(',', $uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname,mobile');
foreach ($res_u as $key => $value) {
$users[$value['id']] = array('nickname' => $value['nickname'], 'mobile' => $value['mobile']);
}
foreach ($res as $key => $value) {
$setValue = array();
$user = $users[$value['uid']];
$setValue['id'] = $value['id'];
$setValue['uid'] = $value['uid'];
$setValue['nickname'] = $user['nickname'];
$setValue['mobile'] = $user['mobile'];
$setValue['lottery'] = $value['lottery'] ? $this->mdLuckyBagUsers->get_gift($value['lottery'], 1)['title'] : '未中奖';
$setValue['gift_bag'] = $value['gift_bag'];
$setValue['zhu_li_count'] = $this->mdLuckyBagLog->count(['uid' => $value['uid']]);
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$lotterys = $this->mdLuckyBagUsers->count(['lottery>' => 0]);
$gift_bags = $this->mdLuckyBagUsers->count(['gift_bag' => 1]);
$menuAry = array(array('id' => 1, 'title' => "中奖", 'value' => $lotterys, 'tag' => '人'),
array('id' => 2, 'title' => "入门礼包", 'value' => $gift_bags, 'tag' => '人'));
$ary['menuAry'] = $menuAry;
$ary['lotteryAry'] = $this->mdLuckyBagUsers->get_gift(0, 1);
$ary['giftBagAry'] = $this->giftBagAry;
$this->data['ary'] = $ary;
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '福袋活动用户';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/liche/luckybag/lists', true);
}
public function lists_log()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$uid = intval($params['uid']);
$re_u = $this->user_service->get(array('id' => $uid));
$nickname = $re_u['nickname'] ? $re_u['nickname'] : '未授权';
$lists = $users = $where = [];
$where['uid'] = $uid;
$count = $this->mdLuckyBagLog->count($where);
if ($count) {
$res = $this->mdLuckyBagLog->select($where, 'id desc', $params['page'], $params['size']);
$uids = array_column($res, 'cf_uid');
$res_u = $this->user_service->select(array('id in (' . implode(',', $uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname,mobile');
foreach ($res_u as $key => $value) {
$users[$value['id']] = array('nickname' => $value['nickname'], 'mobile' => $value['mobile']);
}
foreach ($res as $key => $value) {
$setValue = array();
$user = $users[$value['cf_uid']];
$setValue['nickname'] = $user['nickname'];
$setValue['mobile'] = $user['mobile'];
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = $nickname . '_助力用户';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/liche/luckybag/lists_log', true);
}
public function get()
{
}
public function add()
{
}
public function edit()
{
}
public function edit_gift_bag()
{
$params = $this->input->post();
$uid = intval($params['uid']);
if (!$uid) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$re_u = $this->mdLuckyBagUsers->get(['uid' => $uid]);
if (!$re_u) {
throw new Hd_exception('无此用户!', API_CODE_FAIL);
}
$jsondata = $re_u['jsondata'] ? json_decode($re_u['jsondata'], true) : [];
$jsondata['gift_bag_time'] = date('Y-m-d H:i:s');
$this->mdLuckyBagUsers->update(['gift_bag' => 1, 'jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)], ['uid' => $uid]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
}
+228 -9
View File
@@ -1,29 +1,35 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim.
* User: lcc
* Date: 2019/12/06
* Time: 10:02
*/
class Main extends HD_Controller
{
class Main extends HD_Controller{
public function __construct(){
public function __construct()
{
$this->app_id = 1;
parent::__construct();
$this->load->model('app/liche/App_liche_cms_model', 'cmsM');
$this->load->model('app/liche/App_liche_users_model', 'userM');
$this->load->model('topics/topics_model', 'mdTopics');
$this->load->model('Subjects_model', 'subM');
$this->load->model('bobing/bobing_user_model', 'mdBobingUser');
$this->load->model('app/user_accountlog_model');
$this->load->model('app/liche/app_liche_luckybag_users_model', 'mdLuckyBagUsers');
}
public function index(){
public function index()
{
/*应用状况*/
$conditions = array();
/*小程序设置 start*/
$list = array();
$list = [];
// 用户数据
$value = $this->userM->count([]);
$list[] = array(
@@ -33,9 +39,6 @@ class Main extends HD_Controller{
array('name' => '查看详情', 'url' => '/app/liche/member/index'),
),
);
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
$list = [];
$value = $this->subM->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '话题管理',
@@ -53,12 +56,96 @@ class Main extends HD_Controller{
array('name' => '查看详情', 'url' => '/app/liche/cms/index'),
),
);
$value = $this->mdTopics->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '专题(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/topics/topics?app_id=' . $this->app_id),
),
);
$value = $this->mdLuckyBagUsers->count();
$list[] = array(
'title' => '福袋活动(人)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/liche/luckybag'),
),
);
// $appConfig = $this->mdBobingUser->appConfig();
// $value = $this->mdBobingUser->count(array('act_key' => $appConfig['act_key'], 'app_id' => $appConfig['app_id']));
// $list[] = array(
// 'title' => '博饼(人)',
// 'value' => $value,
// 'btns' => array(
// array('name' => '查看详情', 'url' => '/app/bobing/member?app_id=' . $this->app_id),
// ),
// );
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
/*小程序设置 end*/
$list = [];
$value = $this->userM->count(['dealer' => 1, 'up_uid' => 0]);
$list[] = array(
'title' => '分销用户(人)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/appdistribution/distribution?app_id=' . $this->app_id),
),
);
//消费订单
$this->load->model('apporder/order_purchase_model');
$value = $this->order_purchase_model->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '消费订单(笔)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/order/purchase?app_id=' . $this->app_id),
),
);
//分销体现
$value = $this->user_accountlog_model->count_log(array('lc_app_user_account.app_id' => $this->app_id,'lc_app_user_accountlog.trade_type'=>2));
$list[] = array(
'title' => '用户提现(笔)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/liche/cash/lists'),
),
);
//购车
$this->load->model('app/liche/app_liche_orders_model');
$value = $this->app_liche_orders_model->count(['pid'=>0]);
$list[] = array(
'title' => '购车订单(笔)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/liche/order'),
),
);
$this->load->model('auto/auto_introduce_model', 'mdAutoIntroduce');
$value = $this->mdAutoIntroduce->count(["status<>-1" => null]);
$list[] = array(
'title' => '车型介绍(条)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/auto/introduce'),
),
);
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
/*实时数据 end*/
$this->data['conditions'] = $conditions;
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
$this->data['_title'] = '狸车';
return $this->show_view('/app/main', true);
@@ -99,4 +186,136 @@ class Main extends HD_Controller{
// TODO: Implement export() method.
}
//更新订单
public function get_uporder(){
$this->load->model('apporder/order_purchase_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('receiver/order/receiver_orders_model');
$page = $this->input->get('page');
$size = $this->input->get('size');
$lk = $this->input->get('lk');
!$page && $page = 1;
!$size && $size = 10;
if ($lk) {
$rows = $this->app_liche_orders_model->select([], 'id desc', $page, $size);
print_r($rows);
exit;
}
$where = [
'type in (4,5,6)' => null
];
$new_type = [
4 => 1,
5 => 2,
6 => 3
];
$total = $this->order_purchase_model->count($where);
$rows = $this->order_purchase_model->select($where,'id asc',$page,$size);
if($rows){
$this->load->helper('order');
foreach($rows as $key => $val){
$p_row = $this->app_liche_orders_model->get(['o_id'=>$val['item_id'],'pid'=>0]);
$new_order = $this->app_liche_orders_model->get(['sid'=>$val['sid']]);
if(!$new_order){
$order = $this->receiver_orders_model->get(['id'=>$val['item_id']]);
if($order && $order['brand_id']!=3){
if(!$p_row){
$p_sid = create_order_no(350200,'liche',1,0);
$p_data = [
'o_id' => $val['item_id'],
'uid' => $val['app_uid'],
'sid' => $p_sid,
'pid' => 0,
'c_time' => time(),
];
$order['brand_id'] && $p_data['brand_id'] = $order['brand_id'];
$order['s_id'] && $p_data['s_id'] = $order['s_id'];
$order['v_id'] && $p_data['v_id'] = $order['v_id'];
$order['cor_id'] && $p_data['cor_id'] = $order['cor_id'];
$order['incor_id'] && $p_data['incor_id'] = $order['incor_id'];
$p_id = $this->app_liche_orders_model->add($p_data);
}else{
$p_id = $p_row['id'];
}
if($p_id){
$order_type = $new_type[$val['type']];
if($val['type']==6){
$su_p_row = $this->app_liche_orders_model->get(['pid'=>$p_id,'type'=>$order_type]);
if(!$su_p_row){
$money = $this->order_purchase_model->sum('total_price',['type'=>6,'app_uid'=>$val['app_uid'],'item_id'=>$val['item_id']]);
$sub_p_sid = create_order_no(350200,'liche',1,$order_type);
$p_data = [
'o_id' => $val['item_id'],
'uid' => $val['app_uid'],
'sid' => $sub_p_sid,
'pid' => $p_id,
'type' => $order_type,
'c_time' => time(),
];
$order['brand_id'] && $p_data['brand_id'] = $order['brand_id'];
$order['s_id'] && $p_data['s_id'] = $order['s_id'];
$order['v_id'] && $p_data['v_id'] = $order['v_id'];
$order['cor_id'] && $p_data['cor_id'] = $order['cor_id'];
$order['incor_id'] && $p_data['incor_id'] = $order['incor_id'];
$money && $p_data['total_price'] = $money['total_price'];
$su_p_id = $this->app_liche_orders_model->add($p_data);
}else{
$su_p_id = $su_p_row['id'];
}
if($val['status']>1){
$add_data = [
'o_id' => $val['item_id'],
'uid' => $val['app_uid'],
'sid' => $val['sid'],
'pid' => $su_p_id,
'total_price' => $val['total_price'],
'type' => $order_type,
'status' => 1,
'c_time' => $val['c_time']
];
$order['brand_id'] && $add_data['brand_id'] = $order['brand_id'];
$order['s_id'] && $add_data['s_id'] = $order['s_id'];
$order['v_id'] && $add_data['v_id'] = $order['v_id'];
$order['cor_id'] && $add_data['cor_id'] = $order['cor_id'];
$order['incor_id'] && $add_data['incor_id'] = $order['incor_id'];
$val['mch_id'] && $add_data['mch_id'] = $val['mch_id'];
$val['pay_price'] && $add_data['pay_price'] = $val['pay_price'];
$val['pay_time'] && $add_data['pay_time'] = $val['pay_time'];
$this->app_liche_orders_model->add($add_data);
$this->app_liche_orders_model->update(['status'=>1],['id'=>$su_p_id]);
}
}else{
$add_data = [
'o_id' => $val['item_id'],
'uid' => $val['app_uid'],
'sid' => $val['sid'],
'pid' => $p_id,
'total_price' => $val['total_price'],
'type' => $order_type,
'c_time' => $val['c_time']
];
$order['brand_id'] && $add_data['brand_id'] = $order['brand_id'];
$order['s_id'] && $add_data['s_id'] = $order['s_id'];
$order['v_id'] && $add_data['v_id'] = $order['v_id'];
$order['cor_id'] && $add_data['cor_id'] = $order['cor_id'];
$order['incor_id'] && $add_data['incor_id'] = $order['incor_id'];
$val['mch_id'] && $add_data['mch_id'] = $val['mch_id'];
$val['pay_price'] && $add_data['pay_price'] = $val['pay_price'];
$val['pay_time'] && $add_data['pay_time'] = $val['pay_time'];
$add_data['status'] = $val['status']>1 ? 1 : 0;
$this->app_liche_orders_model->add($add_data);
}
}
}
}
}
echo "do finish,total:{$total},剩余:" . ($total - $page * $size);
}else{
echo "do end";
}
}
}
+16 -27
View File
@@ -41,7 +41,18 @@ class Member extends HD_Controller{
$count = $this->userM->count($where);
$lists = $this->userM->select($where,'id desc',$page,$size);
foreach($lists as &$row_user){
if(SUPER_ADMIN == $this->role){//超级管理员才允许操作用户的披上超级马甲
$majia = array();
if($row_user['jsondata']){
$json = json_decode($row_user['jsondata'], true);
$majia = $json['majia'] ? $json['majia'] : array();
}
$row_user['umajia'] = $majia;
}
}
$this->data['app_id'] = 1;
$this->data['lists'] = $lists;
$this->data['_title'] = '用户列表';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
@@ -110,34 +121,12 @@ class Member extends HD_Controller{
public function edit()
{
$id = $this->input->post('id');
$nickname = $this->input->post('nickname');
$mobile = $this->input->post('mobile');
$headimg = $this->input->post('logo');
if (!$mobile) {
return $this->show_json(SYS_CODE_FAIL, '输入手机号');
}
if (!$nickname) {
return $this->show_json(SYS_CODE_FAIL, '输入昵称');
}
$old = $this->userM->get(array('id' => $id));
if (4 != $old['group_id']) {
return $this->show_json(SYS_CODE_FAIL, '只支持编辑马甲');
}
$exist = $this->userM->get(array('mobile' => $mobile, 'id <>' => $id));
if ($exist) {
return $this->show_json(SYS_CODE_FAIL, '手机号的用户存在');
}
$upd = array(
'mobile' => $mobile,
'nickname' => $nickname,
'headimg' => $headimg ? $headimg : '',
);
$dealer = $this->input->post('dealer');
$manage = $this->input->post('manage');
$upd = [];
isset($dealer) && $upd['dealer'] = $dealer;
isset($manage) && $upd['manage'] = $manage;
$this->userM->update($upd, array('id' => $id));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
+196
View File
@@ -0,0 +1,196 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim.
* User: lcc
* Date: 2021/11/30
* Time: 10:02
*/
class Order extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('app/liche/app_liche_users_model');
$this->load->model('sys/sys_company_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$this->data['params'] = $params = $this->input->get();
$page = $input['page'];
$size = $input['size'];
!$page && $page = 1;
!$size && $size = 10;
$lists = [];
$where = [
'pid' => 0,
'status>=' => 0
];
if($params['mobile']){
$mobile = trim($params['mobile']);
$w_order = $this->orders_model->select(["mobile like '%{$mobile}%'"=>null],'','','','id');
$w_o_ids_arr = array_column($w_order,'id');
$w_o_ids = -1;
$w_o_ids_arr && $w_o_ids = implode(',',$w_o_ids_arr);
$where["o_id in ({$w_o_ids})"] = null;
}
$count = $this->app_liche_orders_model->count($where);
if($count){
$rows = $this->app_liche_orders_model->select($where,'id desc',$page,$size,'id,o_id,sid,c_time');
$type_arr = $this->app_liche_orders_model->get_type_arr();
$o_id_arr = array_column($rows,'o_id');
$order_rows = [];
if($o_id_arr){
$o_id_str = implode(',',$o_id_arr);
$o_where = [
"id in ($o_id_str)" => null
];
$order_rows = $this->orders_model->map('id','',$o_where,'','','','id,sid,name,mobile');
}
foreach($rows as $key => $val){
$order = $order_rows[$val['o_id']] ? $order_rows[$val['o_id']][0] : [];
$sub_lists = [];
$sub_where = [
'pid>' => 0,
'o_id' => $val['o_id'],
'status>=' => 0
];
$sub_rows = $this->app_liche_orders_model->select($sub_where, 'id asc', 1, 20, 'id,total_price,pay_price,type,pay_time,mch_id,descrip,status');
if($sub_rows){
foreach($sub_rows as $item){
$company = '';
if ($item['mch_id']) {
$company = $this->sys_company_model->get(['wx_mchid' => $item['mch_id']], 'short');
}
$sub_lists[] = [
'id' => $item['id'],
'total_price' => $item['total_price'],
'pay_price' => $item['pay_price'],
'type_cn' => $type_arr[$item['type']],
'descrip' => $item['descrip'],
'status' => $item['status'],
'company' => $company ? $company['short'] : '',
];
}
}
$lists[] = [
'o_id' => $val['o_id'],
'sid' => $order['sid'],
'name' => $order['name'],
'mobile' => $order['mobile'],
'c_time' => date('Y-m-d H:i',$val['c_time']),
'sub_lists' => $sub_lists
];
}
}
$this->data['lists'] = $lists;
$this->data['_title'] = '购车订单列表';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
return $this->show_view('/app/liche/order/lists', true);
}
public function get()
{
}
public function add()
{
// TODO: Implement add() method.
}
public function edit()
{
}
public function del()
{
// TODO: Implement del() method.
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
//确认收款
public function edit_pay(){
$id = $this->input->post('id');
$row = $this->app_liche_orders_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '订单不存在');
}
if($row['status']){
return $this->show_json(SYS_CODE_FAIL, '订单已支付');
}
$this->load->service('apporder/payment_service', array('app_id' => 1));
$descrip = '后台确认线下交款';
$p_row = $this->app_liche_orders_model->get(['id'=>$row['pid']]);
if($row['type']==3){
$srv_pay = $this->app_liche_orders_model->count(['type'=>2,'status'=>0,'o_id'=>$row['o_id']]);
if($srv_pay){
return $this->show_json(SYS_CODE_FAIL, '请先完成服务费订单');
}
}
if($row['type']==3 && !$p_row['pid']){ //尾款
//是否存在未支付订单
$un_pay = $this->app_liche_orders_model->count(['type'=>3,'o_id'=>$row['o_id'],'id!='=>$row['id'],'status'=>0]);
if($un_pay){
return $this->show_json(SYS_CODE_FAIL, '存在未支付尾款子订单,请先完成子订单');
}
//未支付金额
$pay = $this->app_liche_orders_model->sum('total_price',['type'=>3,'o_id'=>$row['o_id'],'id!='=>$row['id']]);
$need_pay = $row['total_price'] - $pay['total_price'];
if($need_pay<=0){
return $this->show_json(SYS_CODE_FAIL, '需支付金额必须大于0');
}
$this->load->helper('order');
$sid = create_order_no(350200,'liche',1,$row['type']);
$sub_data = [
'o_id' => $row['o_id'],
'sid' => $sid,
'uid' => $row['uid'],
'entrust_uid' => $row['entrust_uid'],
'mch_id' => $row['mch_id'],
'pid' => $row['id'],
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'cor_id' => $row['cor_id'],
'incor_id' => $row['incor_id'],
'total_price' => $need_pay,
'type' => 3,
'c_time' => time()
];
$res = $this->app_liche_orders_model->add($sub_data);
if(!$res){
return $this->show_json(SYS_CODE_FAIL, '创建订单失败');
}
$result = $this->payment_service->after_pay_liche($sid,$need_pay,$descrip);
}else{
$result = $this->payment_service->after_pay_liche($row['sid'],$row['total_price'],$descrip);
}
if($result['code']){
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
}
}
+211
View File
@@ -0,0 +1,211 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Channel extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/App_licheb_users_model', 'mdUsers');
$this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model("area_model", 'mdArea');
}
//首页信息
public function index()
{
$this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = [];
$where = ['group_id' => 4, 'status' => 1];
if ($params['uname']) {
$where['uname like "%' . $params['uname'] . '%"'] = null;
}
if ($params['mobile']) {
$where['mobile like "%' . $params['mobile'] . '%"'] = null;
}
$count = $this->mdUsers->count($where);
if ($count) {
$fileds = "id,uname,mobile,c_time";
$res = $this->mdUsers->select($where, "id desc", $params['page'], $params['size'], $fileds);
foreach ($res as $key => $value) {
$setValue = [];
$bizs = $this->db->select('lc_app_licheb_channel_biz.biz_id')
->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left')
->where(['lc_app_licheb_channel_biz.uid' => $value['id'], 'lc_biz.status' => 1])
->count_all_results('lc_app_licheb_channel_biz');
$setValue['id'] = $value['id'];
$setValue['uname'] = $value['uname'];
$setValue['mobile'] = $value['mobile'];
$setValue['bizs'] = $bizs;
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '渠道列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/licheb/channel/lists', true);
}
public function lists_biz()
{
$params = $this->input->get();
if (!$params['uid']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$result = $this->dataSelect($params);
$count = $result['count'];
$this->data['lists'] = $result['lists'];
$this->data['params'] = $result['params'];
$this->data['_title'] = $result['_title'];
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/licheb/channel/lists_biz', true);
}
private function dataSelect($params)
{
$lists = [];
$where['lc_biz.status'] = 1;
$_title = '门店列表';
if ($params['uid']) {
$where['lc_app_licheb_channel_biz.uid'] = $params['uid'];
$re = $this->mdUsers->get(array('id' => $params['uid']));
$re['uname'] && $_title = $re['uname'] . '_门店列表';
}
!$params['city_id'] && $params['city_id'] = '';
!$params['county_id'] && $params['county_id'] = '';
if ($params['biz_name']) {
$where['lc_biz.biz_name like "%' . $params['biz_name'] . '%"'] = null;
}
if ($params['city_id']) {
$where['lc_biz.city_id'] = $params['city_id'];
}
if ($params['county_id']) {
$where['lc_biz.county_id'] = $params['county_id'];
}
$count = $this->db->select('lc_app_licheb_channel_biz.biz_id')
->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left')
->where($where)
->count_all_results('lc_app_licheb_channel_biz');
if ($count) {
$offset = ($params['page'] - 1) * $params['size'];
$limit = $params['size'];
$this->db->from('lc_app_licheb_channel_biz');
$this->db->join('lc_biz', "lc_biz.id = lc_app_licheb_channel_biz.biz_id", 'left');
$this->db->select('lc_biz.id,lc_biz.biz_name,lc_biz.county_id,lc_biz.c_time');
$this->db->where($where);
$this->db->order_by('lc_app_licheb_channel_biz.id Desc');
$this->db->limit($limit, $offset);
!$params['uid'] && $this->db->group_by('lc_app_licheb_channel_biz.biz_id');
$res = $this->db->get()->result_array();
$county_id_arr = array_unique(array_column($res, 'county_id'));
$Areas = $this->mdArea->get_map_by_county_ids($county_id_arr, 'city_name,county_name,county_id', 'county_id');
foreach ($res as $key => $value) {
$setValue = [];
$county = $Areas[$value['county_id']][0];
$setValue['biz_name'] = $value['biz_name'];
$setValue['county_name'] = $county ? $county['city_name'] . '-' . $county['county_name'] : '';
$setValue['wjkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 0, 'brand_id<>' => 3, 'biz_id<>' => 1]);
$setValue['dtkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'dt_time<>' => '0000-00-00 00:00:00', 'brand_id<>' => 3, 'biz_id<>' => 1]);
$setValue['ddkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 2, 'brand_id<>' => 3, 'biz_id<>' => 1]);
$setValue['zbkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 3, 'brand_id<>' => 3, 'biz_id<>' => 1]);
$setValue['orders'] = $this->mdOrders->count(['biz_id' => $value['id'], 'status>=' => 0, 'brand_id<>' => 3, 'biz_id<>' => 1]);
$setValue['days'] = round((time() - $value['c_time']) / 3600 / 24) . '天';
if (!$params['uid']) {
$this->db->from('lc_app_licheb_channel_biz');
$this->db->join('lc_app_licheb_users', "lc_app_licheb_users.id = lc_app_licheb_channel_biz.uid", 'left');
$this->db->select('lc_app_licheb_users.uname');
$this->db->where(['lc_app_licheb_channel_biz.biz_id' => $value['id']]);
$res_u = $this->db->get()->result_array();
$unames = $res_u ? implode(',', array_column($res_u, 'uname')) : '';
$setValue['uname'] = $unames;
}
$lists[] = $setValue;
}
}
$data['lists'] = $lists;
$data['params'] = $params;
$data['count'] = $count;
$data['_title'] = $_title;
return $data;
}
//展示单条数据
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$result = $this->dataSelect($params);
$fileName = $result['_title'] . '数据统计';
foreach ($result['lists'] as $key => $value) {
$temp['biz_name'] = $value['biz_name'];
$temp['county_name'] = $value['county_name'];
$temp['wjkhs'] = $value['wjkhs'];
$temp['dtkhs'] = $value['dtkhs'];
$temp['ddkhs'] = $value['ddkhs'];
$temp['zbkhs'] = $value['zbkhs'];
$temp['orders'] = $value['orders'];
$temp['days'] = $value['days'];
!$params['uid'] && $temp['uname'] = $value['uname'];
$data[] = $temp;
}
$indexs = [
'biz_name' => '门店',
'county_name' => '地区',
'wjkhs' => '未见客户数',
'dtkhs' => '到店客户数',
'ddkhs' => '订单客户数',
"zbkhs" => "战败客户数",
"orders" => "订单数",
"days" => "创建时间",
];
!$params['uid'] && $indexs['uname'] = "渠道经理";
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+73 -6
View File
@@ -1,28 +1,36 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim.
* User: lcc
* Date: 2019/12/06
* Time: 10:02
*/
class Main extends HD_Controller
{
class Main extends HD_Controller{
public function __construct(){
public function __construct()
{
$this->app_id = 2;
parent::__construct();
$this->load->model('app/licheb/App_licheb_users_model', 'userM');
$this->load->model('app/licheb/syt_activity_model', 'mdSytActivity');
$this->load->model('app/material/Material_template_model', 'mdTemplate');
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
$this->load->model('topics/topics_model', 'mdTopics');
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
}
public function index(){
public function index()
{
/*应用状况*/
$conditions = array();
/*小程序设置 start*/
$list = array();
// 用户数据
$list = [];
$value = $this->userM->count([]);
$list[] = array(
'title' => '用户(人)',
@@ -31,8 +39,67 @@ class Main extends HD_Controller{
array('name' => '查看详情', 'url' => '/app/licheb/member/index'),
),
);
$value = $this->userM->count(['group_id' => 4, 'status' => 1]);
$list[] = array(
'title' => '渠道列表(人)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/licheb/channel'),
),
);
$value = $this->mdTemplate->count();
$list[] = array(
'title' => '素材模版(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/material/template/index?app_id=' . $this->app_id),
),
);
$value = $this->mdMaterialBiz->count(array('app_id' => $this->app_id), 'distinct(biz_id)');
$list[] = array(
'title' => '素材门店统计(家)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/material/template/lists_biz?app_id=' . $this->app_id),
),
);
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
$list = array();
$value = $this->mdTopics->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '专题(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/topics/topics?app_id=' . $this->app_id),
),
);
$value = $this->mdSytActivity->count(array('status>' => -1));
$list[] = array(
'title' => '私域通-活动(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/licheb/sytactivity'),
),
);
$value = $this->mdPolyvSession->count();
$list[] = array(
'title' => '直播-场次报表',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/live/polyv'),
),
);
$value = $this->mdUsersLog->count();
$list[] = array(
'title' => '顾问日志',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => 'app/licheb/userslog'),
),
);
$conditions[] = array('icon' => 'am-icon-user', 'list' => $list);
/*小程序设置 end*/
/*实时数据 end*/
+338 -33
View File
@@ -2,14 +2,17 @@
defined('BASEPATH') OR exit('No direct script access allowed');
class Member extends HD_Controller{
class Member extends HD_Controller
{
private $groups = [1=>'销售',2=>'店长',3=>'掌柜'];
private $groups = [1 => '销售', 2 => '店长', 3 => '老板', 4 => '渠道经理'];
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/App_licheb_users_model', 'userM');
$this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz');
$this->load->model("biz/biz_model");
}
//首页信息
@@ -21,27 +24,56 @@ class Member extends HD_Controller{
//数据列表
public function lists($where = array())
{
$input = $this->input->get();
$page = $input['page'];
$size = $input['size'];
$params = $this->input->get();
$page = $params['page'];
$size = $params['size'];
!$page && $page = 1;
!$size && $size = 20;
if ($input['name']) {
$where['uname like "%' . $input['name'] . '%"'] = null;
$this->data['name'] = $input['name'];
if ($params['name']) {
$where['uname like "%' . $params['name'] . '%"'] = null;
$this->data['name'] = $params['name'];
}
if ($input['mobile']) {
$where['mobile'] = $input['mobile'];
$this->data['mobile'] = $input['mobile'];
if ($params['mobile']) {
$where['mobile'] = $params['mobile'];
$this->data['mobile'] = $params['mobile'];
}
if ($params['group_id']) {
$where['group_id'] = $params['group_id'];
$this->data['group_id'] = $params['group_id'];
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['biz_id'] = '';
}
$count = $this->userM->count($where);
$lists = $this->userM->select($where,'id desc',$page,$size);
foreach($lists as $key=>$val){
$lists = $this->userM->select($where, 'id desc', $page, $size);
foreach ($lists as $key => $val) {
$biz_name = '';
if ($val['group_id'] == 4) {
$biz_name = ' <a href="javascript:void(0)" data-open="/app/licheb/channel/lists_biz?uid=' . $val['id'] . '">门店列表</a>';
} else if ($val['biz_id']) {
$re_biz = $this->biz_model->get(['id' => $val['biz_id'], 'status' => 1], 'biz_name');
$re_biz && $biz_name = $re_biz['biz_name'];
}
$lists[$key]['biz_name'] = $biz_name;
$lists[$key]['group_name'] = $this->groups[$val['group_id']];
if (SUPER_ADMIN == $this->role) {//超级管理员才允许操作用户的披上超级马甲
$majia = array();
if ($val['jsondata']) {
$json = json_decode($val['jsondata'], true);
$majia = $json['majia'] ? $json['majia'] : array();
}
$lists[$key]['umajia'] = $majia;
}
}
$this->data['app_id'] = 2;
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['groupAry'] = $this->groups;
$this->data['_title'] = '用户列表';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
@@ -52,19 +84,61 @@ class Member extends HD_Controller{
//展示单条数据
public function get()
{
$row = [];
$this->data['row'] = $row;
$this->load->model("sys/sys_city_model", 'mdSysCity');
$id = $this->input->get('id');
$row = $this->userM->get(['id' => $id]);
$selectedBrands = [];
if ($id) {
$info = array(
'id' => $row['id'],
'uname' => $row['uname'],
'mobile' => $row['mobile'],
'group_id' => $row['group_id'],
'biz_id' => $row['biz_id'],
'city_id' => $row['city_id'],
);
if ($row['group_id'] == 4) {
$this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz');
$res_biz = $this->mdChannelBiz->select(['uid' => $id], 'id desc', 0, 0, 'biz_id');
$res_biz && $biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
if ($res_biz) {
$biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
$ids = implode(',', $biz_id_arr);
$selectedBrands = $this->biz_model->select(["id in ($ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
}
} else if ($row['biz_id']) {
$re_biz = $this->biz_model->get(["id" => $row['biz_id'], 'status' => 1], 'id ,biz_name');
if ($re_biz) {
$selectedBrands[] = ['biz_id' => $re_biz['id'], 'name' => $re_biz['biz_name']];
}
}
$action = '/app/licheb/member/edit';
$_title = '编辑用户';
} else {
$info = array('biz_id' => '', 'group_id' => '', 'city_id' => 0);
$action = '/app/licheb/member/add';
$_title = '添加用户';
}
$show_info['cityList'] = $this->mdSysCity->select(['status' => 1], 'id desc', 0, 0, 'city_id,name');
$this->data['selectedBrands'] = $selectedBrands;
$this->data['show_info'] = $show_info;
$this->data['info'] = $info;
$this->data['groups'] = $this->groups;
$this->data['_title'] = $row ? '编辑用户' : '添加用户';
return $this->show_view('app/licheb/member/get');
$this->data['action'] = $action;
$this->data['_title'] = $_title;
return $this->show_view('app/licheb/member/get', true);
}
//添加单条数据
public function add(){
$uname = $this->input->post('uname');
$mobile = $this->input->post('mobile');
$group_id = $this->input->post('group_id');
public function add()
{
$info = $this->input->post('info');
$uname = $info['uname'];
$mobile = $info['mobile'];
$group_id = $info['group_id'];
$bizs = $info['bizs'];
$city_id = $info['city_id'];
$biz_id_arr = array_column($bizs, 'biz_id');
if (!mobile_valid($mobile)) {
return $this->show_json(SYS_CODE_FAIL, '输入正确手机号');
@@ -81,22 +155,31 @@ class Member extends HD_Controller{
$add = array(
'mobile' => $mobile,
'uname' => $uname,
'city_id' => $city_id,
'status' => 1,
'c_time' => time(),
);
$group_id && $add['group_id'] = $group_id;
$biz_id_arr && $add['biz_id'] = implode(',', $biz_id_arr);
$id = $this->userM->add($add);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
if ($id && $group_id == 4 && $biz_id_arr) {//加狸车宝渠道门店
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr]);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功', '/app/licheb/member');
}
//编辑单条数据
public function edit()
{
$id = $this->input->post('id');
$nickname = $this->input->post('nickname');
$mobile = $this->input->post('mobile');
$group_id = $this->input->post('group_id');
$info = $this->input->post('info');
$id = $info['id'];
$uname = $info['uname'];
$nickname = $info['nickname'];
$mobile = $info['mobile'];
$group_id = $info['group_id'];
$bizs = $info['bizs'];
$city_id = $info['city_id'];
$biz_id_arr = is_array($bizs) ? array_column($bizs, 'biz_id') : '';
if (!mobile_valid($mobile)) {
return $this->show_json(SYS_CODE_FAIL, '输入正确手机号');
@@ -109,13 +192,19 @@ class Member extends HD_Controller{
$upd = array(
'mobile' => $mobile,
'city_id' => $city_id,
);
$group_id && $add['group_id'] = $group_id;
$nickname && $add['nickname'] = $nickname;
$upd['group_id'] = $group_id ? $group_id : 0;
$upd['biz_id'] = $biz_id_arr ? implode(',', $biz_id_arr) : 0;
$nickname && $upd['nickname'] = $nickname;
$uname && $upd['uname'] = $uname;
$this->userM->update($upd, array('id' => $id));
if ($id && $group_id == 4) {//加狸车宝渠道门店
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr, 'edit' => 1]);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
@@ -128,7 +217,26 @@ class Member extends HD_Controller{
//批量操作(默认修改状态)
public function batch()
{
$field = $this->input->post('field');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
$ids = explode(',', $ids);
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$where = array('id in(' . implode(',', $ids) . ')' => null);
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
if (!$id) {
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
}
$data['status'] = $status;
$this->userM->update($data, $where);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//导出数据列表
@@ -136,4 +244,201 @@ class Member extends HD_Controller{
{
}
function json_lists()
{
$biz_id = $this->input->post('biz_id');
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$type = intval($this->input->post('type'));
$if_mobile = intval($this->input->post('if_mobile'));
$where = array();
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$whre['status > -1'] = null;
}
$biz_id && $where['biz_id'] = $biz_id;
$total = $this->userM->count($where);
$lists = $uids = array();
if ($total) {
$select = $if_mobile ? 'id,uname,mobile' : 'id,uname';
$rows = $this->userM->select($where, 'id desc', $page, $size, $select);
foreach ($rows as $v) {
$uids[$v['id']] = $v['id'];
$title = $if_mobile ? $v['uname'] . "({$v['mobile']})" : $v['uname'];
$lists[] = array(
'id' => $v['id'],
'title' => $title,
);
}
}
if ($type == 1) {//查找渠道经理
$where2 = ['status' => 1, 'group_id' => 4];
$where2["id in(select uid from lc_app_licheb_channel_biz where biz_id = {$biz_id})"] = null;
$total2 = $this->userM->count($where2);
if ($total2) {
$rows2 = $this->userM->select($where2, 'id desc', $page, $size, 'id,uname,mobile');
foreach ($rows2 as $v) {
if (!$uids[$v['id']]) {
$title = $if_mobile ? $v['uname'] . "({$v['mobile']}渠道)" : $v['uname'] . '(渠道)';
$lists[] = array(
'id' => $v['id'],
'title' => $title,
);
}
}
}
}
$this->data = array('total' => $total, 'list' => $lists, 'list2' => $rows2);
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:加狸车宝渠道门店
* Created on: 2021/11/12 14:54
* Created by: dengbw
* @param array $json
*/
function channel_biz($json = [])
{
$biz_ids = $json['biz_id_arr'] ? implode(',', $json['biz_id_arr']) : 0;
if ($json['edit'] == 1) {//编辑删除未添加的
$where_d['uid'] = $json['uid'];
$biz_ids && $where_d["biz_id not in({$biz_ids})"] = null;
$this->mdChannelBiz->delete($where_d);
}
if (!$biz_ids) {
return;
}
$res_b = $this->biz_model->select(["id in({$biz_ids})" => null], '', 0, 0, 'id as biz_id');
foreach ($res_b as $key => $value) {
$where = ["uid" => $json['uid'], 'biz_id' => $value['biz_id']];
$re_cb = $this->mdChannelBiz->get($where);
if (!$re_cb) {
$where['c_time'] = time();
$this->mdChannelBiz->add($where);
}
}
}
/**
* Notes:获取门店渠道经理
* Created on: 2021/11/15 11:31
* Created by: dengbw
* @return bool
*/
function get_channel_uid()
{
$biz_id = $this->input->get('biz_id');
if (!$biz_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$res_b = $this->mdChannelBiz->select(["biz_id" => $biz_id], '', 0, 0, 'uid');
$this->data = $res_b ? array_column($res_b, 'uid') : [];
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:保存渠道管理员
* Created on: 2021/11/15 15:54
* Created by: dengbw
* @return bool
*/
function edit_channel_uid()
{
$biz_id = $this->input->post('biz_id');
$channel_uid = $this->input->post('channel_uid');
if (!$biz_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re_biz = $this->biz_model->get(['id' => $biz_id]);
if (!$re_biz) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
$where_del['biz_id'] = $biz_id;
if ($channel_uid) {
$channel_uid_str = implode(',', $channel_uid);
$where_del["uid not in({$channel_uid_str})"] = null;
}
$res_b = $this->mdChannelBiz->select($where_del, '', 0, 0, 'uid'); //临时
$this->mdChannelBiz->delete($where_del);
//临时
foreach ($res_b as $key => $value) {
$res_b2 = $this->mdChannelBiz->select(['uid' => $value['uid']], '', 0, 0, 'biz_id');
$biz_id_up = $res_b2 ? array_unique(array_column($res_b2, 'biz_id')) : 0;
$biz_id_up && $biz_id_up = implode(',', $biz_id_up);
$this->userM->update(['biz_id' => $biz_id_up], ['id' => $value['uid']]);
}
//临时
if ($channel_uid) {
foreach ($channel_uid as $key => $value) {
$uid = $value;
$where = ["uid" => $uid, 'biz_id' => $biz_id];
$re_cb = $this->mdChannelBiz->get($where);
if (!$re_cb) {
$where['c_time'] = time();
$this->mdChannelBiz->add($where);
//临时
$res_b2 = $this->mdChannelBiz->select(['uid' => $uid], '', 0, 0, 'biz_id');
$biz_id_up = $res_b2 ? array_unique(array_column($res_b2, 'biz_id')) : 0;
$biz_id_up && $biz_id_up = implode(',', $biz_id_up);
$this->userM->update(['biz_id' => $biz_id_up], ['id' => $uid]);
//临时
}
}
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
/**
* Notes:获取门店管理员
* Created on: 2021/11/15 17:33
* Created by: dengbw
* @return bool
*/
function get_users_group()
{
$group_id = $this->input->get('group_id');
$biz_id = $this->input->get('biz_id');
$admin_name = $this->input->get('admin_name');
if (!$group_id || !$biz_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$where = ["group_id" => $group_id, 'status >' => -1];
$admin_name && $where['uname like "%' . $admin_name . '%"'] = null;
$res_u = $this->userM->select($where, '', 0, 0, 'id,uname as name');
$res_u2 = $this->userM->select(array_merge($where, ['biz_id' => $biz_id]), '', 0, 0, 'id');
$this->data['admins'] = $res_u ? $res_u : [];
$this->data['admin_id'] = $res_u2 ? array_column($res_u2, 'id') : [];
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:保存门店管理员
* Created on: 2021/11/15 17:33
* Created by: dengbw
* @return bool
*/
function edit_users_group()
{
$biz_manage = $this->input->post('biz_manage');
if (!$biz_manage['biz_id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if (!$biz_manage['admin_name']) {
$where_del = ['biz_id' => $biz_manage['biz_id'], 'group_id' => $biz_manage['group_id']];
if ($biz_manage['admin_id']) {
$admin_id_str = implode(',', $biz_manage['admin_id']);
$where_del["id not in({$admin_id_str})"] = null;
}
$this->userM->update(["biz_id" => 0], $where_del);
}
foreach ($biz_manage['admin_id'] as $key => $value) {
$this->userM->update(["biz_id" => $biz_manage['biz_id']], ['id' => $value]);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
}
@@ -0,0 +1,425 @@
<?php
/**
* Notes:私域通-活动
* Created on: 2021/11/19 13:38
* Created by: dengbw
*/
class Sytactivity extends HD_Controller
{
private $statusAry = array(-1 => '已删除', 0 => '待审核', 1 => '已通过', 2 => '未通过');
private $app_id = 2;
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/syt_activity_model', 'mdSytActivity');
$this->load->model('app/licheb/syt_activity_kpidata_model', 'mdSytKpiData');
$this->load->model('topics/topics_model', 'mdTopics');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where = array('status>' => -1);
$count = $this->mdSytActivity->count($where);
if ($count) {
$this->load->library('MyEncryption');
$res = $this->mdSytActivity->select($where, 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$z_title = '';
if ($value['z_id']) {
$re_t = $this->mdTopics->get(array('id' => $value['z_id']));
$re_t['title'] && $z_title = $re_t['title'];
}
$setValue['z_id'] = $value['z_id'];
$setValue['z_title'] = $z_title;
$setValue['s_time'] = $value['s_time'];
$setValue['e_time'] = $value['e_time'];
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$setValue['status_name'] = $this->statusAry[$value['status']];
$url = http_host_com('home') . "/h5/syt/special?skey=" . $this->myencryption->base64url_encode("a_id=" . $value['id']);
$setValue['url'] = urlencode($url);
$lists[] = $setValue;
}
}
$this->data['_title'] = '私域通-活动列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
return $this->show_view('/app/licheb/syt/activity_lists', true);
}
public function get()
{
$params = $this->input->get();
$id = intval($params['id']);
$status_list = $kpi_list = array();
$posters = array('imgs_url' => array(), 'imgs' => array());
$share_title = $remark = $rule = $bg_color = $btn_color = '';
if ($id > 0) {
$re = $this->mdSytActivity->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '活动不存在!');
}
$_title = '编辑私域通活动';
$dataInfo['editType'] = 0;
$dataInfo['edit_url'] = '/app/licheb/sytactivity/edit';
$dataInfo['brand_id'] = $re['brand_id'] ? explode(',', $re['brand_id']) : [];
$dataInfo['status'] = $re['status'];
$dataInfo['z_id'] = $re['z_id'];
if ($re['jsondata']) {
$jsondata = json_decode($re['jsondata'], true);
$share_title = $jsondata['share_title'] ? $jsondata['share_title'] : '';
$remark = $jsondata['remark'] ? $jsondata['remark'] : '';
$rule = $jsondata['rule'] ? $jsondata['rule'] : '';
$bg_color = $jsondata['bg_color'] ? $jsondata['bg_color'] : '';
$btn_color = $jsondata['btn_color'] ? $jsondata['btn_color'] : '';
if ($jsondata['posters']) {
foreach ($jsondata['posters'] as $key => $value) {
$posters['imgs_url'][] = array("value" => $value['url'], "src" => build_qiniu_image_url($value['url']));
$posters['imgs'][] = array("value" => $value['url'], "src" => build_qiniu_image_url($value['url'])
, "width" => $value['width'], "height" => $value['height']);
}
}
}
if ($re['z_id']) {
$re_t = $this->mdTopics->get(array('id' => $re['z_id']));
$dataInfo['z_title'] = $re_t['title'] ? $re_t['title'] : '';
}
$dataInfo['title'] = $re['title'];
$dataInfo['img'] = $re['img'] ? $re['img'] : '';
$dataInfo['img_url'] = $re['img'] ? build_qiniu_image_url($re['img']) : '';
$dataInfo['time'] = $re['s_time'] . " ~ " . $re['e_time'];
$jsonkpi = $re['jsonkpi'] ? json_decode($re['jsonkpi'], true) : '';
foreach ($this->mdSytKpiData->kpiAry() as $key => $value) {
$kpi_list[$key] = array("num" => $jsonkpi[$key]['num'], "score" => $jsonkpi[$key]['score']
, "title" => $value['title1'], "num_tag" => $value['num_tag'], "score_tag" => $value['score_tag']);
}
} else {
$_title = '新增私域通活动';
$dataInfo['editType'] = 2;
$dataInfo['edit_url'] = '/app/licheb/sytactivity/add';
$dataInfo['brand_id'] = [];
$dataInfo['status'] = 0;
$dataInfo['z_id'] = 0;
foreach ($this->mdSytKpiData->kpiAry() as $key => $value) {
$kpi_list[$key] = array("num" => 0, "score" => 0, "title" => $value['title1'], "num_tag" => $value['num_tag']
, "score_tag" => $value['score_tag']);
}
}
foreach ($this->statusAry as $key => $value) {
$status_list[] = array("id" => $key, "name" => $value);
}
$dataInfo['kpi_list'] = $kpi_list;
$dataInfo['id'] = $id;
$dataInfo['share_title'] = $share_title;
$dataInfo['remark'] = $remark;
$dataInfo['rule'] = $rule;
$dataInfo['bg_color'] = $bg_color;
$dataInfo['btn_color'] = $btn_color;
$this->data['info'] = $dataInfo;
$this->data['status_list'] = $status_list;
$this->data['posters'] = $posters;
$this->data['_title'] = $_title;
return $this->show_view('/app/licheb/syt/activity_edit', true);
}
public function add()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
$brand_id = $info['brand_id'] ? implode(',', $info['brand_id']) : 0;
$re = $this->mdSytActivity->get(array("z_id" => $info['z_id'], "brand_id" => $brand_id));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '该活动已存在!');
}
$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['remark'] = $info['remark'];
$json_data['rule'] = $info['rule'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['btn_color'] = $info['btn_color'];
//海报
$posters = array();
if ($info['posters']) {
foreach ($info['posters'] as $key => $value) {
$posters[] = array('url' => $value['value'], 'width' => $value['width'], 'height' => $value['height']);
}
}
$json_data['posters'] = $posters;
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$addData = array("brand_id" => $brand_id, "title" => $info['title'], "z_id" => $info['z_id'], "img" => $info['img']
, "jsonkpi" => $jsonkpi, "jsondata" => $jsondata, "status" => $info['status'], "c_time" => time());
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$addData['s_time'] = $time[0];
$addData['e_time'] = $time[1];
}
$id = $this->mdSytActivity->add($addData);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '新增活动失败!');
}
$this->data['type'] = 'add';
$this->data['id'] = $id;
return $this->show_json(SYS_CODE_SUCCESS, '新增活动成功!');
}
public function edit()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['remark'] = $info['remark'];
$json_data['rule'] = $info['rule'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['btn_color'] = $info['btn_color'];
//海报
$posters = array();
if ($info['posters']) {
foreach ($info['posters'] as $key => $value) {
$posters[] = array('url' => $value['value'], 'width' => $value['width'], 'height' => $value['height']);
}
}
$json_data['posters'] = $posters;
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$brand_id = $info['brand_id'] ? implode(',', $info['brand_id']) : 0;
$updateData = array("brand_id" => $brand_id, "title" => $info['title'], "z_id" => $info['z_id'], "img" => $info['img']
, "jsonkpi" => $jsonkpi, "jsondata" => $jsondata);
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$updateData['s_time'] = $time[0];
$updateData['e_time'] = $time[1];
}
$this->mdSytActivity->update($updateData, array('id' => $info['id']));
$this->data['type'] = 'edit';
return $this->show_json(SYS_CODE_SUCCESS, '修改活动成功!');
}
/**
* Notes:修改商家状态
* Created on: 2020/8/24 11:12
* Created by: dengbw
* @return bool|void
*/
public function edit_status()
{
$info = $this->input->post('info');
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$this->mdSytActivity->update(array("status" => intval($info['status'])), array('id' => $info['id']));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
/**
* Notes:私域通-报名
* Created on: 2020/12/23 14:54
* Created by: dengbw
* @return bool
*/
public function get_enroll_lists()
{
$params = $this->input->get();
if (!$params['a_id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdSytActivity->get(array('id' => $params['a_id']));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '活动不存在!');
}
$res = $this->enrollSelect($params);
$lists = $res['lists'];
$count = $res['count'];
$params = $res['params'];
$this->data['_title'] = '私域通-[' . $re['title'] . ']报名';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $res['params'];
return $this->show_view('/app/hdy/syt/enroll_lists', true);
}
public function enrollSelect($params)
{
$this->load->model('app/syt/syt_activity_enroll_model', 'mdSytActivityEnroll');
$this->load->model('app/syt/syt_activity_team_model', 'mdSytActivityTeam');
$this->load->model('app/hdy/app_hdy_users_model', 'mdHdyUsers');
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['a_id'] = intval($params['a_id']);
$lists = array();
$where = array('status' => 1, 'a_id' => $params['a_id']);
if ($params['nickname']) {
$where['nickname LIKE "%' . $params['nickname'] . '%"'] = null;
}
if ($params['mobile']) {
$where['mobile LIKE "%' . $params['mobile'] . '%"'] = null;
}
$count = $this->mdSytActivityEnroll->count($where);
if ($count) {
$res = $this->mdSytActivityEnroll->select($where, 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['nickname'] = $value['nickname'];
$setValue['mobile'] = $value['mobile'];
$cf_name = '-';
if ($value['cf_uid'] || $value['t_id']) {
if ($value['cf_uid']) {
$reUsers = $this->mdHdyUsers->get(array('id' => $value['cf_uid']));
$reUsers['nickname'] && $cf_name = $reUsers['nickname'];
} else {
$re_t = $this->mdSytActivityTeam->get(array('id' => $value['t_id']));
$re_t['name'] && $cf_name = $re_t['name'];
}
}
$setValue['cf_name'] = $cf_name;
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$lists[] = $setValue;
}
}
$data['lists'] = $lists;
$data['count'] = $count;
$data['params'] = $params;
return $data;
}
/**
* Notes:检查新增/修改数据
* Created on: 2020/8/20 11:59
* Created by: dengbw
* @param $info
* @return array
*/
private function checkData($info)
{
$msg = '';
$code = SYS_CODE_FAIL;
if (!$info) {
$msg = '非法参数';
} else if (!$info['brand_id']) {
$msg = '请选择活动品牌';
} else if (!$info['z_id']) {
$msg = '请选择活动专题';
} else if (!$info['title']) {
$msg = '请输入活动标题';
} else if (!$info['time']) {
$msg = '请选择活动时间';
} else {
$code = SYS_CODE_SUCCESS;
}
return array('code' => $code, 'msg' => $msg);
}
public function del()
{
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->enrollSelect($params);
$fileName = '私域通报名';
foreach ($res['lists'] as $key => $value) {
$temp['nickname'] = $value['nickname'];
$temp['mobile'] = $value['mobile'];
$temp['cf_name'] = $value['cf_name'];
$temp['c_time'] = $value['c_time'];
$data[] = $temp;
}
$indexs = [
'nickname' => '报名昵称',
'mobile' => '手机号',
'cf_name' => '来源',
'c_time' => '创建时间'
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out($data, $indexs, $fileName . "_" . date('YmdHis'));
}
public function get_topics()
{
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$topicsList = array();
$where = array('status >' => -1, 'app_id' => $this->app_id);
$title = $this->input->post('title');
$title && $where['title like "%' . $title . '%"'] = null;
$count = $this->mdTopics->count($where);
if ($count) {
$res = $this->mdTopics->select($where, 'id desc', $page, $size);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$topicsList[] = $setValue;
}
}
$this->data['topicsList'] = $topicsList;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['topicsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
private function get_biz_name($info)
{
$biz_name = '';
if ($info['biz_id']) {
$reBiz = $this->mdBiz->get(array('id' => $info['biz_id']), 'biz_name');
$biz_name = $reBiz['biz_name'];
} else if ($info['brand_id']) {
$reBrand = $this->mdBrand->get(array('id' => $info['brand_id']), 'brand_name');
$biz_name = $reBrand['brand_name'];
}
return $biz_name;
}
public function get_kpidata()
{
$this->load->model('app/syt/syt_activity_member_model', 'mdSytActivityMember');
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 10;
$where = array('status' => 1);
$res = $this->mdSytActivityMember->select($where, 'id asc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$this->mdSytKpiData->update(array("t_id" => $value['t_id']), array("a_id" => $value['a_id'], 'cf_uid' => $value['uid']));
}
print_r($res);
exit;
}
}
+138
View File
@@ -0,0 +1,138 @@
<?php
/**
* Notes:私域通-门店
* Created on: 2021/11/19 13:38
* Created by: dengbw
*/
class Sytbiz extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/syt_biz_score_model', 'mdSytBizScore');
$this->load->model('app/licheb/syt_activity_model', 'mdSytActivity');
$this->load->model('app/licheb/syt_activity_kpidata_model', 'mdSytActivityKpiData');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('app/app_weixin_users_model', 'mdWeixinUsers');
$this->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$re_a = $this->mdSytActivity->get(array("id" => $params['a_id']));
if (!$re_a) {
return $this->show_json(SYS_CODE_FAIL, "活动不存在");
}
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where = array('a_id' => $params['a_id']);
if($params['biz_name']){
$where['biz_id in (select id from lc_biz where biz_name like "%' . $params['biz_name'] . '%")'] = null;
}
$count = $this->mdSytBizScore->count($where);
if ($count) {
$res = $this->mdSytBizScore->select($where, 'score DESC,id ASC', $params['page'], $params['size'], 'biz_id,score,c_time');
$str_biz_ids = implode(',', array_column($res, 'biz_id'));
$map_biz = $this->mdBiz->map('id', 'biz_name', ["id in ({$str_biz_ids})" => null]);
foreach ($res as $key => $value) {
$setValue = array();
$enroll_count = $this->mdSytActivityKpiData->count(['kpi' => 'enroll', 'a_id' => $params['a_id'], 'biz_id' => $value['biz_id']]);
$browse_count = $this->mdSytActivityKpiData->count(['kpi' => 'browse', 'a_id' => $params['a_id'], 'biz_id' => $value['biz_id']]);
$share_count = $this->mdSytActivityKpiData->count(['kpi' => 'share', 'a_id' => $params['a_id'], 'biz_id' => $value['biz_id']]);
$setValue['biz_id'] = $value['biz_id'];
$setValue['biz_name'] = $map_biz[$value['biz_id']];
$setValue['score'] = $value['score'];
$setValue['enroll_count'] = $enroll_count;
$setValue['browse_count'] = $browse_count;
$setValue['share_count'] = $share_count;
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['_title'] = $re_a['title'] . '-门店统计';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
return $this->show_view('/app/licheb/syt/activity_biz_lists', true);
}
public function get_achievement()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$re_a = $this->mdSytActivity->get(array("id" => $params['a_id']));
if (!$re_a) {
return $this->show_json(SYS_CODE_FAIL, "活动不存在");
}
$_title = $re_a['title'].'_业绩报告';
$where['a_id'] = $params['a_id'];
$params['biz_id'] && $where['biz_id'] = $params['biz_id'];
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
$menu_lists = $lists = array();
foreach ($this->mdSytActivityKpiData->kpiAry() as $key => $value) {
$count = $this->mdSytActivityKpiData->count(array_merge($where, array('kpi' => $key)));
$menu_lists[] = array('title' => $value['title2'], 'value' => $count, 'num_tag' => $value['num_tag']);
}
$count = $this->mdSytActivityKpiData->count($where);
if ($count) {
$res = $this->mdSytActivityKpiData->select($where, 'id DESC', $params['page'], $params['size'], 'id,uid,cf_uid,kpi,c_time');
$uids_arr = array_unique(array_column($res, 'uid'));
$cf_uids_arr = array_unique(array_column($res, 'cf_uid'));
$uids = $this->mdWeixinUsers->get_map_by_ids($uids_arr, 'id,nickname');
$cf_uids = $this->mdLichebUsers->get_map_by_ids($cf_uids_arr, 'id,uname');
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['nickname'] = $cf_uids[$value['cf_uid']][0]['uname'] ? $cf_uids[$value['cf_uid']][0]['uname'] : '无昵称';
$nickname = $uids[$value['uid']][0]['nickname'] ? $uids[$value['uid']][0]['nickname'] : '无昵称';
$setValue['title'] = '新增' . $this->mdSytActivityKpiData->kpiAry($value['kpi'], 'title') . '用户' . $nickname;
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['_title'] = $_title;
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['menu_lists'] = $menu_lists;
$this->data['params'] = $params;
return $this->show_view('/app/licheb/syt/achievement_lists', true);
}
public function get()
{
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
}
+388
View File
@@ -0,0 +1,388 @@
<?php
/**
* Notes:私域通-直播
* Created on: 2022/05/07 13:38
* Created by: dengbw
*/
class Sytlive extends HD_Controller
{
private $statusAry = array(-1 => '已删除', 0 => '待审核', 1 => '已通过', 2 => '未通过');
private $app_id = 2;
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/syt_live_model', 'mdSytLive');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where = array('status>' => -1);
$count = $this->mdSytLive->count($where);
if ($count) {
$this->load->library('MyEncryption');
$res = $this->mdSytLive->select($where, 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$setValue['session_id'] = $value['session_id'];
$setValue['s_time'] = $value['s_time'];
$setValue['e_time'] = $value['e_time'];
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$setValue['status_name'] = $this->statusAry[$value['status']];
$url = http_host_com('home') . "/h5/syt/live?skey=" . $this->myencryption->base64url_encode("id=" . $value['id']);
$setValue['url'] = urlencode($url);
$lists[] = $setValue;
}
}
$this->data['_title'] = '私域通-直播列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
return $this->show_view('/app/licheb/syt/live_lists', true);
}
public function get()
{
$params = $this->input->get();
$id = intval($params['id']);
$title = $session_id = $img = $img_url = $share_title = $share_img = $share_img_url = $time = $rule = '';
if ($id > 0) {
$re = $this->mdSytLive->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '活动不存在!');
}
$_title = '编辑私域通-直播';
$dataInfo['editType'] = 0;
$dataInfo['edit_url'] = '/app/licheb/sytlive/edit';
$dataInfo['status'] = $re['status'];
$re['title'] && $title = $re['title'];
$re['session_id'] && $session_id = $re['session_id'];
if ($re['img']) {
$img = $re['img'];
$img_url = build_qiniu_image_url($re['img']);
}
$re['s_time'] && $time = $re['s_time'] . " ~ " . $re['e_time'];
if ($re['jsondata']) {
$jsondata = json_decode($re['jsondata'], true);
$jsondata['share_title'] && $share_title = $jsondata['share_title'];
if ($jsondata['share_img']) {
$share_img = $jsondata['share_img'];
$share_img_url = build_qiniu_image_url($jsondata['share_img']);
}
$jsondata['rule'] && $rule = $jsondata['rule'];
}
} else {
$_title = '新增私域通-直播';
$dataInfo['editType'] = 2;
$dataInfo['edit_url'] = '/app/licheb/sytlive/add';
$dataInfo['status'] = 0;
}
$status_list = [];
foreach ($this->statusAry as $key => $value) {
$status_list[] = array("id" => $key, "name" => $value);
}
$dataInfo['id'] = $id;
$dataInfo['title'] = $title;
$dataInfo['session_id'] = $session_id;
$dataInfo['img'] = $img;
$dataInfo['img_url'] = $img_url;
$dataInfo['time'] = $time;
$dataInfo['share_title'] = $share_title;
$dataInfo['share_img'] = $share_img;
$dataInfo['share_img_url'] = $share_img_url;
$dataInfo['rule'] = $rule;
$this->data['info'] = $dataInfo;
$this->data['status_list'] = $status_list;
$this->data['_title'] = $_title;
return $this->show_view('/app/licheb/syt/live_edit', true);
}
public function add()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
$re = $this->mdSytLive->get(array("session_id" => $info['session_id'], "status<>" => -1));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '该直播场次已存在!');
}
//$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['share_img'] = $info['share_img'];
$json_data['rule'] = $info['rule'];
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$addData = array("title" => $info['title'], "session_id" => $info['session_id'], "img" => $info['img'],
"jsondata" => $jsondata, "status" => $info['status'], "c_time" => time());
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$addData['s_time'] = $time[0];
$addData['e_time'] = $time[1];
}
$id = $this->mdSytLive->add($addData);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '新增直播失败!');
}
$this->data['type'] = 'add';
$this->data['id'] = $id;
return $this->show_json(SYS_CODE_SUCCESS, '新增直播成功!');
}
public function edit()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['remark'] = $info['remark'];
$json_data['rule'] = $info['rule'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['btn_color'] = $info['btn_color'];
//海报
$posters = array();
if ($info['posters']) {
foreach ($info['posters'] as $key => $value) {
$posters[] = array('url' => $value['value'], 'width' => $value['width'], 'height' => $value['height']);
}
}
$json_data['posters'] = $posters;
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$brand_id = $info['brand_id'] ? implode(',', $info['brand_id']) : 0;
$updateData = array("brand_id" => $brand_id, "title" => $info['title'], "z_id" => $info['z_id'], "img" => $info['img']
, "jsonkpi" => $jsonkpi, "jsondata" => $jsondata);
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$updateData['s_time'] = $time[0];
$updateData['e_time'] = $time[1];
}
$this->mdSytLive->update($updateData, array('id' => $info['id']));
$this->data['type'] = 'edit';
return $this->show_json(SYS_CODE_SUCCESS, '修改活动成功!');
}
/**
* Notes:修改商家状态
* Created on: 2020/8/24 11:12
* Created by: dengbw
* @return bool|void
*/
public function edit_status()
{
$info = $this->input->post('info');
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$this->mdSytLive->update(array("status" => intval($info['status'])), array('id' => $info['id']));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
/**
* Notes:私域通-报名
* Created on: 2020/12/23 14:54
* Created by: dengbw
* @return bool
*/
public function get_enroll_lists()
{
$params = $this->input->get();
if (!$params['a_id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdSytLive->get(array('id' => $params['a_id']));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '活动不存在!');
}
$res = $this->enrollSelect($params);
$lists = $res['lists'];
$count = $res['count'];
$params = $res['params'];
$this->data['_title'] = '私域通-[' . $re['title'] . ']报名';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $res['params'];
return $this->show_view('/app/hdy/syt/enroll_lists', true);
}
public function enrollSelect($params)
{
$this->load->model('app/syt/syt_activity_enroll_model', 'mdSytLiveEnroll');
$this->load->model('app/syt/syt_activity_team_model', 'mdSytLiveTeam');
$this->load->model('app/hdy/app_hdy_users_model', 'mdHdyUsers');
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['a_id'] = intval($params['a_id']);
$lists = array();
$where = array('status' => 1, 'a_id' => $params['a_id']);
if ($params['nickname']) {
$where['nickname LIKE "%' . $params['nickname'] . '%"'] = null;
}
if ($params['mobile']) {
$where['mobile LIKE "%' . $params['mobile'] . '%"'] = null;
}
$count = $this->mdSytLiveEnroll->count($where);
if ($count) {
$res = $this->mdSytLiveEnroll->select($where, 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['nickname'] = $value['nickname'];
$setValue['mobile'] = $value['mobile'];
$cf_name = '-';
if ($value['cf_uid'] || $value['t_id']) {
if ($value['cf_uid']) {
$reUsers = $this->mdHdyUsers->get(array('id' => $value['cf_uid']));
$reUsers['nickname'] && $cf_name = $reUsers['nickname'];
} else {
$re_t = $this->mdSytLiveTeam->get(array('id' => $value['t_id']));
$re_t['name'] && $cf_name = $re_t['name'];
}
}
$setValue['cf_name'] = $cf_name;
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$lists[] = $setValue;
}
}
$data['lists'] = $lists;
$data['count'] = $count;
$data['params'] = $params;
return $data;
}
/**
* Notes:检查新增/修改数据
* Created on: 2020/8/20 11:59
* Created by: dengbw
* @param $info
* @return array
*/
private function checkData($info)
{
$msg = '';
$code = SYS_CODE_FAIL;
if (!$info) {
$msg = '非法参数';
} else if (!$info['title']) {
$msg = '请输入活动标题';
} else if (!$info['img']) {
$msg = '请上传头部图片';
} else if (!$info['session_id']) {
$msg = '请输入直播场次';
} else if (!$info['time']) {
$msg = '请选择直播时间';
} else if (!$info['rule']) {
$msg = '请输入活动规则';
} else {
$code = SYS_CODE_SUCCESS;
}
return array('code' => $code, 'msg' => $msg);
}
public function del()
{
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->enrollSelect($params);
$fileName = '私域通报名';
foreach ($res['lists'] as $key => $value) {
$temp['nickname'] = $value['nickname'];
$temp['mobile'] = $value['mobile'];
$temp['cf_name'] = $value['cf_name'];
$temp['c_time'] = $value['c_time'];
$data[] = $temp;
}
$indexs = [
'nickname' => '报名昵称',
'mobile' => '手机号',
'cf_name' => '来源',
'c_time' => '创建时间'
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out($data, $indexs, $fileName . "_" . date('YmdHis'));
}
public function get_topics()
{
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$topicsList = array();
$where = array('status >' => -1, 'app_id' => $this->app_id);
$title = $this->input->post('title');
$title && $where['title like "%' . $title . '%"'] = null;
$count = $this->mdTopics->count($where);
if ($count) {
$res = $this->mdTopics->select($where, 'id desc', $page, $size);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$topicsList[] = $setValue;
}
}
$this->data['topicsList'] = $topicsList;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['topicsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
private function get_biz_name($info)
{
$biz_name = '';
if ($info['biz_id']) {
$reBiz = $this->mdBiz->get(array('id' => $info['biz_id']), 'biz_name');
$biz_name = $reBiz['biz_name'];
} else if ($info['brand_id']) {
$reBrand = $this->mdBrand->get(array('id' => $info['brand_id']), 'brand_name');
$biz_name = $reBrand['brand_name'];
}
return $biz_name;
}
public function get_kpidata()
{
$this->load->model('app/syt/syt_activity_member_model', 'mdSytLiveMember');
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 10;
$where = array('status' => 1);
$res = $this->mdSytLiveMember->select($where, 'id asc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$this->mdSytKpiData->update(array("t_id" => $value['t_id']), array("a_id" => $value['a_id'], 'cf_uid' => $value['uid']));
}
print_r($res);
exit;
}
}
+208
View File
@@ -0,0 +1,208 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:狸车宝顾问_日志
* Created on: 2022/4/15 16:43
* Created by: dengbw
*/
class Userslog extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('area_model', 'mdArea');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$data = $this->dataSelect($params);
$data['typeAry'] = $this->mdBiz->type_ary();
$this->data = $data;
$this->show_view('app/licheb/userslog/lists', true);
}
private function dataSelect($params)
{
$lists = $where = [];
if ($params['uname']) {
$where["sale_id in(select id from lc_app_licheb_users where uname like '%{$params['uname']}%')"] = null;
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["biz_id in ({$str_ids})"] = null;
} else {
$where['biz_id'] = -2;
}
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['biz_id'] = '';
}
if ($params['type']) {
$where["type"] = $params['type'];
} else {
$params['type'] = '';
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["log_date>="] = $time[0];
$time[1] && $where["log_date<="] = $time[1];
}
$total = $this->mdUsersLog->count($where);
if ($total) {
$res = $this->mdUsersLog->select($where, "id desc", $params['page'], $params['size']);
$sale_ids = $biz_ids = [];
foreach ($res as $v) {
$v['sale_id'] && !in_array($v['sale_id'], $sale_ids) && $sale_ids[] = $v['sale_id'];
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
}
$map_sale = $map_biz = $map_city = [];
if ($sale_ids) {
$str_ids = implode(',', $sale_ids);
$map_sale = $this->mdUsers->map('id', 'uname', ["id in ({$str_ids})" => null]);
}
if ($biz_ids) {
$str_ids = implode(',', $biz_ids);
$map_biz = $this->mdBiz->map('id', 'biz_name,type', ["id in ({$str_ids})" => null]);
}
$offlineSources = $this->mdCustomers->offlineSources();
$typeAry = $this->mdBiz->type_ary();
foreach ($res as $v) {
$uname = $biz_name = $biz_type = $customers_info = '';
$customers = 0;
$map_sale[$v['sale_id']] && $uname = $map_sale[$v['sale_id']];
$map_biz[$v['biz_id']]['biz_name'] && $biz_name = $map_biz[$v['biz_id']]['biz_name'];
$map_biz[$v['biz_id']]['type'] && $biz_type = $typeAry[$map_biz[$v['biz_id']]['type']];
$temp = ['uname' => $uname, 'biz_type' => $biz_type, 'biz_name' => $biz_name, 'defeats' => $v['defeats']
, 'c_num' => $v['c_num'], 'a_num' => $v['a_num'], 't_num' => $v['t_num'], 'orders' => $v['orders'], 'bills' => $v['bills']
, 'follows' => $v['follows'], 'qy_adds' => $v['qy_adds'], 'qy_dels' => $v['qy_dels'], 'log_date' => $v['log_date']];
$customer_json = $v['customer_json'] ? json_decode($v['customer_json'], true) : [];
foreach ($offlineSources as $key1 => $value1) {
$nums = intval($v['customer_' . $key1]);
if ($params['size'] == 10000) {//导出使用
$temp['customer_' . $key1] = $nums;
foreach ($value1['list'] as $key2 => $value2) {
$temp['customer_' . $key2] = intval($customer_json[$key1]['list'][$key2]['num']);
}
}
if ($nums) {
$customers += $nums;
if ($params['size'] != 10000) {
if ($customers_info) {
$customers_info = $customers_info . '+' . $value1['name'] . '(' . $nums . ')';
} else {
$customers_info = $value1['name'] . '(' . $nums . ')';
}
}
}
}
$customers_info && $customers = $customers . '=' . $customers_info;
$temp['customers'] = $customers;
$lists[] = $temp;
}
}
if ($params['size'] != 10000) {
$sum = $this->mdUsersLog->sum('customers', $where);
$menus[] = ['title' => "客户数", 'value' => intval($sum['customers']), 'tag' => '人'];
$sum_c = $this->mdUsersLog->sum('c_num', $where);
$sum = $this->mdUsersLog->sum('a_num', $where);
$menus[] = ['title' => "进店人数/进店次数", 'value' => intval($sum_c['c_num']) . '人 / ' . intval($sum['a_num']), 'tag' => '人次'];
$sum = $this->mdUsersLog->sum('t_num', $where);
$menus[] = ['title' => "试驾数", 'value' => intval($sum['t_num']), 'tag' => '次'];
$sum = $this->mdUsersLog->sum('follows', $where);
$menus[] = ['title' => "跟进数", 'value' => intval($sum['follows']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('orders', $where);
$menus[] = ['title' => "订单数", 'value' => intval($sum['orders']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('defeats', $where);
$menus[] = ['title' => "战败数", 'value' => intval($sum['defeats']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('bills', $where);
$menus[] = ['title' => "开票数", 'value' => intval($sum['bills']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('qy_adds', $where);
$menus[] = ['title' => "新增企微", 'value' => intval($sum['qy_adds']), 'tag' => '人'];
$sum = $this->mdUsersLog->sum('qy_dels', $where);
$menus[] = ['title' => "删除企微", 'value' => intval($sum['qy_dels']), 'tag' => '人'];
$data['menus'] = $menus;
}
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$data['lists'] = $lists;
$data['params'] = $params;
$data['_title'] = "顾问日志";
return $data;
}
public function get()
{
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->dataSelect($params);
$fileName = $res['_title'];
$offlineSources = $this->mdCustomers->offlineSources();
foreach ($res['lists'] as $key => $value) {
$data[] = $value;
}
$indexs = ['biz_name' => '门店', 'uname' => '顾问', 'customers' => '客户数'];
foreach ($offlineSources as $key1 => $value1) {
$indexs['customer_' . $key1] = '【' . $value1['name'] . '】';
foreach ($value1['list'] as $key2 => $value2) {
$indexs['customer_' . $key2] = $value2;
}
}
$indexs['c_num'] = '进店人数';
$indexs['a_num'] = '进店次数';
$indexs['t_num'] = '试驾数';
$indexs['follows'] = '跟进数';
$indexs['orders'] = '订单数';
$indexs['defeats'] = '战败数';
$indexs['bills'] = '开票数';
$indexs['qy_adds'] = '新增企微';
$indexs['qy_dels'] = '删除企微';
$indexs['log_date'] = '日期';
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+402
View File
@@ -0,0 +1,402 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:素材模板
* Created on: 2021/9/30 12:45
* Created by: dengbw
*/
class Template extends HD_Controller
{
private $cf_id = 24;//素材报名
public function __construct()
{
parent::__construct();
$this->load->model('app/material/Material_template_model', 'mdTemplate');
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
$this->load->model('app/material/Material_biz_statistics_model', 'mdBizStatistics');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model("biz/biz_model", 'mdBiz');
}
//首页信息
public function index()
{
$this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = array();
$where = array('app_id' => $params['app_id']);
if ($params['type']) {
$where['type'] = $params['type'];
}
if (strlen($params['status'])) {
$where['status'] = $params['status'];
}
$count = $this->mdTemplate->count($where);
if ($count) {
$fileds = "id,title,type,status,brand_ids,c_time";
$res = $this->mdTemplate->select($where, "id desc", $params['page'], $params['size'], $fileds);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$setValue['type_name'] = $this->mdTemplate->typeAry()[$value['type']];
$setValue['status_name'] = $this->mdTemplate->statusAry()[$value['status']];
$brands = '';
if ($value['brand_ids']) {
$res_b = $this->mdAutoBrand->select(array("id in ({$value['brand_ids']})" => null, 'status' => 1), "id desc", 0, 0, 'name');
if ($res_b) {
$brands = array_column($res_b, 'name');
$brands = implode(',', $brands);
}
}
$setValue['brands'] = $brands;
$setValue['c_time'] = date('Y-m-d H:i:s', $value["c_time"]);
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['typeAry'] = $this->mdTemplate->typeAry();
$this->data['statusAry'] = $this->mdTemplate->statusAry();
$this->data['_title'] = '素材模板列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/material/template/lists', true);
}
public function lists_biz()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = array();
$where = array('app_id' => $params['app_id']);
if ($params['biz_name']) {
$where['biz_id in (select id from lc_biz where biz_name like "%' . $params['biz_name'] . '%")'] = null;
}
$count = $this->mdMaterialBiz->count($where, 'distinct(biz_id)');
if ($count) {
$fileds = "distinct(biz_id)";
$res = $this->mdMaterialBiz->select($where, "biz_id desc", $params['page'], $params['size'], $fileds);
$str_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_biz = $this->mdBiz->map('id', 'biz_name', array("id in({$str_ids})" => null));
foreach ($res as $key => $value) {
$setValue = array();
$biz_id = intval($value['biz_id']);
$re_s = $this->mdBizStatistics->sum('browse_num', array('app_id' => $params['app_id'], 'biz_id' => $biz_id));
$count_c = $this->mdCustomers->count(array('biz_id' => $biz_id, 'cf_id' => $this->cf_id, 'status >=' => 0));
$count_o = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0));
$setValue['browse_num'] = intval($re_s['browse_num']);
$setValue['baoming_num'] = $count_c;
$setValue['order_name'] = $count_o;
$setValue['biz_id'] = $biz_id;
$setValue['biz_name'] = $map_biz[$value['biz_id']];
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '门店使用数据列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/material/template/lists_biz', true);
}
public function lists_t_biz()
{
$params = $this->input->get();
$t_id = intval($params['t_id']);
if (!$t_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re = $this->mdTemplate->get(array('id' => $t_id));
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = array();
$where = array('app_id' => $params['app_id'], 't_id' => $t_id);
if ($params['biz_name']) {
$where['biz_id in (select id from lc_biz where biz_name like "%' . $params['biz_name'] . '%")'] = null;
}
$count = $this->mdMaterialBiz->count($where);
if ($count) {
$fileds = "biz_id,c_time";
$res = $this->mdMaterialBiz->select($where, "id desc", $params['page'], $params['size'], $fileds);
$str_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_biz = $this->mdBiz->map('id', 'biz_name', array("id in({$str_ids})" => null));
foreach ($res as $key => $value) {
$setValue = array();
$biz_id = intval($value['biz_id']);
$re_s = $this->mdBizStatistics->sum('browse_num', array('app_id' => $params['app_id'], 'biz_id' => $biz_id, 't_id' => $t_id));
$count_c = $this->mdCustomers->count(array('biz_id' => $biz_id, 'cf_id' => $this->cf_id, 'status >=' => 0, 't_id' => $t_id));
$count_o = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0, 'c.t_id' => $t_id));
$setValue['browse_num'] = intval($re_s['browse_num']);
$setValue['baoming_num'] = $count_c;
$setValue['order_name'] = $count_o;
$setValue['biz_id'] = $biz_id;
$setValue['biz_name'] = $map_biz[$value['biz_id']];
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = $re['title'] . '_门店使用数据列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/material/template/lists_t_biz', true);
}
//展示单条数据
public function get()
{
$id = $this->input->get('id');
$info['app_id'] = intval($this->input->get('app_id'));
$info['status'] = 1;
$info['type'] = 4;
$info['cover'] = array('value' => '', 'src' => '');
$info['moments'] = '';
$info['tag_id'] = '';
$info['biz_pop'] = 0;
$json_lists = $json_item = $brands = $pyqwa_list = array();
foreach ($this->mdTemplate->typeAry() as $key => $value) {
$json_lists[$key] = array();
$json_item[$key] = array();
}
if ($id) {
$re = $this->mdTemplate->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '模板不存在!');
}
$moments = $tag_id = '';
$biz_pop = 0;
if ($re['json_data']) {
$json_data = json_decode($re['json_data'], true);
$json_data['biz_pop'] && $biz_pop = $json_data['biz_pop'];
$json_data['moments'] && $moments = $json_data['moments'];
$json_data['tag_id'] && $tag_id = $json_data['tag_id'];
$lists = array();
foreach ($json_data['lists'] as $key => $value) {
if ($re['type'] == 1) {
if ($value['video_type'] == 1) {
$value['video_file_url'] = $value['video'];
$value['video_url'] = build_qiniu_image_url($value['video'], 0, 0, 'video');
$value['video_cover'] = $value['video_url'] . '?vframe/jpg/offset/1';
$value['img'] = $value['img_url'] = '';
} else {
$value['img_url'] = $value['img'] ? build_qiniu_image_url($value['img']) : '';
$value['video_file_url'] = $value['video_url'] = $value['video_cover'] = $value['width'] = $value['height'] = '';
}
} else if ($re['type'] == 2 || $re['type'] == 4) {
$value['img_url'] = $value['img'] ? build_qiniu_image_url($value['img']) : '';
} else if ($re['type'] == 3) {
if ($value['brands']) {
$value['brands'] = $this->mdAutoBrand->select(array("id in ({$value['brands']})" => null, 'status' => 1), "id desc", 0, 0, 'id,name');
} else {
$value['brands'] = array();
}
}
$lists[] = $value;
}
if ($re['type'] == 1) {
$json_lists[1] = $lists;
} else if ($re['type'] == 2) {
$json_lists[2] = $lists;
} else if ($re['type'] == 3) {
$pyqwa_list = $lists;
} else if ($re['type'] == 4) {
$json_lists[4] = $lists;
}
unset($re['json_data']);
}
$info = $re;
$info['biz_pop'] = $biz_pop;
$info['moments'] = $moments;
$info['tag_id'] = $tag_id;
$info['cover'] = $info['cover'] ? array('value' => $info['cover'], 'src' => build_qiniu_image_url($info['cover']))
: array('value' => '', 'src' => '');
if ($info['brand_ids']) {
$brand_ids = str_replace(",0", "", $info['brand_ids']);
$brand_ids = str_replace("0,", "", $brand_ids);
$brands = $this->mdAutoBrand->select(array("id in ({$brand_ids})" => null, 'status' => 1), "id desc", 0, 0, 'id,name');
}
$_title = '编辑素材模板';
$edit_url = '/app/material/template/edit';
} else {
$_title = '新增素材模板';
$edit_url = '/app/material/template/add';
}
$showInfo['statusAry'] = $this->mdTemplate->statusAry();
$showInfo['typeAry'] = $this->mdTemplate->typeAry();
$showInfo['tagAry'] = $this->mdTemplate->tagAry();
$showInfo['bizPopAry'] = [0 => '否', 1 => '是'];
$showInfo['brands'] = $brands;
$showInfo['pyqwa_list'] = $pyqwa_list;
$showInfo['json_lists'] = $json_lists;
$showInfo['json_item'] = $json_item;
$this->data['info'] = $info;
$this->data['showInfo'] = $showInfo;
$this->data['edit_url'] = $edit_url;
$this->data['_title'] = $_title;
return $this->show_view('/app/material/template/edit', true);
}
private function checkInfo($info)
{
$msg = '';
$code = SYS_CODE_FAIL;
if (!$info) {
$msg = '非法参数';
} else if (!$info['title']) {
$msg = '请输入模版名称';
} else if (!$info['cover']['value'] && $info['type'] != 3) {
$msg = '请上传封面图';
} else if (!$info['brand_ids'] && $info['type'] != 3) {
$msg = '请选择适用品牌';
} else {
$code = SYS_CODE_SUCCESS;
}
return array('code' => $code, 'msg' => $msg);
}
//添加单条数据
public function add()
{
$info = $this->input->post('info');
$checkInfo = $this->checkInfo($info);
if (!$checkInfo['code']) {
return $this->show_json($checkInfo['code'], $checkInfo['msg']);
}
$brand_ids = '';
if ($info['brand_ids']) {
$brand_ids = '0,' . implode(',', $info['brand_ids']) . ',0';
}
$json_data['biz_pop'] = $info['biz_pop'];
$json_data['moments'] = $info['moments'];
$json_data['tag_id'] = $info['tag_id'];
if ($info['lists']) {
$lists = array();
foreach ($info['lists'] as $key => $value) {
if ($info['type'] == 1) {
if ($value['video_type'] == 1) {
$value['video'] = $value['video_file_url'];
unset($value['img']);
} else {
unset($value['width']);
unset($value['height']);
}
unset($value['video_file_url']);
unset($value['video_url']);
unset($value['video_cover']);
unset($value['img_url']);
} else if ($info['type'] == 2 || $info['type'] == 4) {
unset($value['img_url']);
} else if ($info['type'] == 3) {
$brands = '';
if ($value['brands']) {
$brands = array_column($value['brands'], 'id');
$brands = implode(',', $brands);
}
$value['brands'] = $brands;
}
$lists[] = $value;
}
$json_data['lists'] = $lists;
}
$editData['json_data'] = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$editData['app_id'] = $info['app_id'];
$editData['title'] = $info['title'];
$editData['cover'] = $info['cover']['value'];
$editData['type'] = $info['type'];
$editData['brand_ids'] = $info['type'] == 3 ? '' : $brand_ids;
$editData['status'] = $info['status'];
$editData['c_time'] = time();
$id = $this->mdTemplate->add($editData);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '新增失败!');
}
return $this->show_json(SYS_CODE_SUCCESS, '新增成功!', '/app/material/template/index?app_id=' . $info['app_id']);
}
//编辑单条数据
public function edit()
{
$info = $this->input->post('info');
$checkInfo = $this->checkInfo($info);
if (!$checkInfo['code']) {
return $this->show_json($checkInfo['code'], $checkInfo['msg']);
}
$brand_ids = '';
if ($info['brand_ids']) {
$brand_ids = '0,' . implode(',', $info['brand_ids']) . ',0';
}
$json_data['biz_pop'] = $info['biz_pop'];
$json_data['moments'] = $info['moments'];
$json_data['tag_id'] = $info['tag_id'];
if ($info['lists']) {
$lists = array();
foreach ($info['lists'] as $key => $value) {
if ($info['type'] == 1) {
if ($value['video_type'] == 1) {
$value['video'] = $value['video_file_url'];
unset($value['img']);
} else {
unset($value['width']);
unset($value['height']);
}
unset($value['video_file_url']);
unset($value['video_url']);
unset($value['video_cover']);
unset($value['img_url']);
} else if ($info['type'] == 2 || $info['type'] == 4) {
unset($value['img_url']);
} else if ($info['type'] == 3) {
$brands = '';
if ($value['brands']) {
$brands = array_column($value['brands'], 'id');
$brands = implode(',', $brands);
}
$value['brands'] = $brands;
}
$lists[] = $value;
}
$json_data['lists'] = $lists;
}
$editData['json_data'] = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$editData['title'] = $info['title'];
$editData['cover'] = $info['cover']['value'];
$editData['type'] = $info['type'];
$editData['brand_ids'] = $info['type'] == 3 ? '' : $brand_ids;
$editData['status'] = $info['status'];
$ret = $this->mdTemplate->update($editData, array('id' => $info['id']));
if (!$ret) {
return $this->show_json(SYS_CODE_FAIL, '修改失败!');
}
return $this->show_json(SYS_CODE_SUCCESS, '修改成功!');
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
}
+402
View File
@@ -0,0 +1,402 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once(dirname(__DIR__) . '/AppBase.php');
/**
* Notes:分销管理
* Created on: 2020/7/15 15:26
* Created by: dengbw
*/
class Distribution extends AppBase
{
private $statisticalAry = array();
public function __construct()
{
parent::__construct();
$this->load->model('app/User_account_model', 'mdUserAccount');
$this->load->model('app/User_accountlog_model', 'mdUserAccountLog');
$this->load->model('app/Deal_log_model', 'mdDealLog');
$this->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
if ($this->app_id) {
$this->load->model($this->mdApp->appConfig()[$this->app_id]['model'], 'mdAppUser');
if ($this->app_info()['lock_fans'] == 1) {
$this->statisticalAry = array(1 => '团队', 2 => '粉丝');
} else {
$this->statisticalAry = array(1 => '团队');
}
}
}
//首页信息
public function index()
{
$this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 10;
$params['statistical'] = $params['statistical'] ? intval($params['statistical']) : 1;
$res = $this->teamSelect($params);
$lists = $res['lists'];
$count = $res['count'];
$this->data['params'] = $res['params'];
$this->data['_title'] = '分销用户列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['statistical_ary'] = $this->statisticalAry;
$this->data['statistical_name'] = $this->statisticalAry[$params['statistical']];
$this->data['lists'] = $lists;
return $this->show_view('appdistribution/team/lists', true);
}
/**
* Notes:分销用户
* Created on: 2020/7/15 10:45
* Created by: dengbw
* @param $params
* @return mixed
*/
private function teamSelect($params)
{
$lists = array();
$count = 0;
$where = array('dealer' => 1, 'up_uid' => 0);
if ($params['nickname']) {
$where['nickname LIKE "%' . trim($params['nickname']) . '%"'] = NULL;
}
if ($params['mobile']) {
$where['mobile LIKE "%' . trim($params['mobile']) . '%"'] = NULL;
}
$res = $this->mdAppUser->select($where, "id desc", $params['page'], $params['size'], 'id,mobile,nickname');
if ($res) {
if (!$params['export']) {
$count = $this->mdAppUser->count($where);
}
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['mobile'] = $value['mobile'];
$setValue['nickname'] = $value['nickname'];
if ($params['statistical'] == 1) {
$setValue['nums'] = $this->mdAppUser->count(array('dealer' => 1, 'up_uid' => $value['id'])) + 1;
$orders = $this->mdDealLog->count(array('app_id' => $this->app_id, 'app_uid' => $value['id']));
$orders_suc = $this->mdDealLog->count(array('app_id' => $this->app_id, 'app_uid' => $value['id'], 'status' => 1));
$orders_suc > $orders && $orders = $orders_suc;
$setValue['orders'] = $orders;
$setValue['orders_suc'] = $orders_suc;
$sum = $this->mdDealLog->sum('money', array('app_id' => $this->app_id, 'app_uid' => $value['id'], 'status' => 1));
$setValue['money'] = number_format_com($sum['money']);
} else if ($params['statistical'] == 2) {
$setValue['nums'] = $this->mdAppUser->count(array('dealer' => 0, 'up_uid' => $value['id']));
$orders = $this->mdDealLog->count(array('app_id' => $this->app_id, 'app_uid' => $value['id'], 'type' => 2));
$orders_suc = $this->mdDealLog->count(array('app_id' => $this->app_id, 'app_uid' => $value['id'], 'type' => 2, 'status' => 1));
$orders_suc > $orders && $orders = $orders_suc;
$setValue['orders'] = $orders;
$setValue['orders_suc'] = $orders_suc;
$sum = $this->mdDealLog->sum('money', array('app_id' => $this->app_id, 'app_uid' => $value['id'], 'type' => 2, 'status' => 1));
$setValue['money'] = number_format_com($sum['money']);
}
$lists[] = $setValue;
}
}
$data['lists'] = $lists;
$data['count'] = $count;
$data['params'] = $params;
return $data;
}
/**
* Notes:分销团队
* Created on: 2020/7/20 17:48
* Created by: dengbw
* @return bool
* @throws Hd_exception
*/
public function get_team()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 10;
$up_uid = $params['up_uid'];
$this->app_id = $params['app_id'];
if (!$up_uid || !$this->app_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$reU = $this->mdAppUser->get(array('id' => $up_uid));
if ($reU['dealer'] != 1 || $reU['up_uid'] != 0) {
throw new Hd_exception('不是团长', API_CODE_FAIL);
}
$this->load->model($this->mdApp->appConfig()[$this->app_id]['model'], 'mdAppUser');
$lists = $where = array();
$_title = $reU['nickname'] ? '【' . $reU['nickname'] . '】分销团队' : '分销团队';
$where_base = array('app_id' => $this->app_id, 'app_uid' => $up_uid);
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where_base["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where_base["c_time <="] = strtotime($time[1] . ' 23:59:59');
$params['time_str'] = str_replace(" ~ ", "", $params['time']);
}
if ($params['statistical'] == 1) {//团员
$where = array('dealer' => 1, 'up_uid' => $up_uid);
if ($params['page'] == 1) {
$where1 = $where2 = $where_base;
$where1['type in(0,2)'] = null;
$where2['type in(0,2)'] = null;
$where2['status'] = 1;
$myValue['id'] = $up_uid;
$myValue['type'] = 0;
$myValue['mobile'] = $reU['mobile'];
$myValue['nickname'] = $reU['nickname'] . '<span style="color: red;">(团长)</span>';
$myValue['orders'] = $this->mdDealLog->count($where1);
$myValue['orders_suc'] = $this->mdDealLog->count($where2);
$mySum = $this->mdDealLog->sum('money', $where2);
$myValue['bring_money'] = number_format_com($mySum['money']);
$lists[] = $myValue;
}
} else if ($params['statistical'] == 2) {//粉丝
$where = array('dealer' => 0, 'up_uid' => $up_uid);
}
if ($params['mobile']){
$where["mobile like '%{$params['mobile']}%'"] = null;
}
$resU = $this->mdAppUser->select($where, 'id DESC', $params['page'], $params['size'], 'id,nickname,mobile');
$count = $this->mdAppUser->count($where);
$params['statistical'] == 1 && $count += 1;
if ($count) {
foreach ($resU as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['type'] = 1;
$setValue['mobile'] = $value['mobile'];
$setValue['nickname'] = $value['nickname'] ? $value['nickname'] : '神秘用户';
if ($params['statistical'] == 1) {
$where1 = $where2 = $where_base;
$where1['t_uid'] = $value['id'];
$where1['type in(1,3)'] = null;
$where2['t_uid'] = $value['id'];
$where2['type in(1,3)'] = null;
$where2['status'] = 1;
$orders = $this->mdDealLog->count($where1);
$orders_suc = $this->mdDealLog->count($where2);
$orders_suc > $orders && $orders = $orders_suc;
$setValue['orders'] = $orders;
$setValue['orders_suc'] = $orders_suc;
$sum = $this->mdDealLog->sum('money', $where2);
$setValue['bring_money'] = number_format_com($sum['money']);
} else if ($params['statistical'] == 2) {
$where1 = $where_base;
$where1['t_uid'] = $value['id'];
$where1['type'] = 2;
$where1['status'] = 1;
$setValue['orders'] = $this->mdDealLog->count($where1);
$sum = $this->mdDealLog->sum('money', $where1);
$setValue['bring_money'] = number_format_com($sum['money']);
}
$lists[] = $setValue;
}
}
if($params['mobile']){
$uids = 0;
$resU && $uids = implode(',',array_column($resU,'id'));
$where_base["t_uid in ({$uids})"] = null;
}
$this->data['team_orders'] = $this->mdDealLog->count($where_base);
$where3 = $where_base;
$where3['status'] = 1;
$this->data['team_orders_suc'] = $this->mdDealLog->count($where3);
$sum = $this->mdDealLog->sum('money', $where3);
$this->data['team_money'] = number_format_com($sum['money']);
$this->data['_title'] = $_title;
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('appdistribution/team/get_team', true);
}
/**
* Notes:佣金明细
* Created on: 2020/7/20 17:48
* Created by: dengbw
* @return bool
*/
public function get_commission()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$status = $params['status'];
$app_uid = $params['app_uid'];
$this->app_id = $params['app_id'];
if (!$app_uid || !$this->app_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->load->model($this->mdApp->appConfig()[$this->app_id]['model'], 'mdAppUser');
$lists = array();
$statusAry = array(0 => '进行中', 1 => '已完成', -1 => '已失效');
$reU = $this->mdAppUser->get(array('id' => $app_uid));
$_title = $reU['nickname'] ? '【' . $reU['nickname'] . '】佣金明细' : '佣金明细';
$where['app_id'] = $this->app_id;
$where['app_uid'] = $app_uid;
if (status_verify($status)) {
$where['status'] = $status;
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
$count = $this->mdDealLog->count($where);
if ($count) {
$res = $this->mdDealLog->select($where, 'id DESC', $params['page'], $params['size'], 'cf_sid,type,status,money,c_time');
$o_ids = array_column($res,'cf_sid') ? implode("','",array_column($res,'cf_sid')) : '';
if($o_ids){
$o_where = [
"sid in ('{$o_ids}')" => null
];
$order_rows = $this->mdOrders->map('sid','',$o_where,'','','','id,sid,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,c_time');
}
foreach ($res as $key => $value) {
$setValue = array();
$order = $order_rows[$value['cf_sid']] ? $order_rows[$value['cf_sid']][0] : [];
$expect_money = 0.00;
$setValue['name'] = $order['name'];
$setValue['mobile'] = $order['mobile'];
$setValue['order_time'] = $order['c_time'] ? date('Y.m.d H:i',$order['c_time']) : '';
$car = '';
if($order){
$brand = $this->auto_brand_model->get(['id'=>$order['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$order['s_id']],'name');
$version = $this->auto_attr_model->get(["id"=>$order['v_id']]);
$car = "{$brand['name']}·{$series['name']}·{$version['title']}";
}
$setValue['car'] = $car;
$setValue['cf_sid'] = $value['cf_sid'];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $statusAry[$value['status']];
$setValue['expect_money'] = $value['money'];
$setValue['total_price'] = number_format_com($total_price);
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['_title'] = $_title;
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['statusAry'] = $statusAry;
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('appdistribution/team/get_commission', true);
}
/**
* Notes:账户资金流水
* Created on: 2020/7/20 17:51
* Created by: dengbw
* @return bool
*/
public function get_accountlog()
{
$trade_type_ary = array(1 => '入账', 2 => '提现', 3 => '冲正');
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$this->app_id = $params['app_id'];
$app_uid = $params['app_uid'];
if (!$app_uid || !$this->app_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->load->model($this->mdApp->appConfig()[$this->app_id]['model'], 'mdAppUser');
$reAc = $this->mdUserAccount->get(array('app_id' => $this->app_id, 'app_uid' => $app_uid));
$account_id = $reAc['id'];
if (!$account_id) {
return $this->show_json(SYS_CODE_FAIL, '无此用户');
}
$reU = $this->mdAppUser->get(array('id' => $app_uid));
$_title = $reU['nickname'] ? '【' . $reU['nickname'] . '】资金流水' : '资金流水';
$where['account_id'] = $account_id;
if ($params['trade_type']) {
$where['trade_type'] = $params['trade_type'];
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
$where2 = $where3 = $where;
$where2['trade_type'] = 1;
$sum2 = $this->mdUserAccountLog->sum('money_in', $where2);
$this->data['money_in'] = number_format_com($sum2['money_in']);
$where3['trade_type'] = 2;
$sum3 = $this->mdUserAccountLog->sum('money_out', $where3);
$this->data['money_out'] = number_format_com($sum3['money_out']);
$lists = array();
$count = $this->mdUserAccountLog->count($where);
if ($count) {
$res = $this->mdUserAccountLog->select($where, 'id DESC', $params['page'], $params['size'], '');
foreach ($res as $key => $value) {
$setValue = array();
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$setValue['sid'] = $value['sid'] ? $value['sid'] : '-';
$setValue['trade_type_name'] = $trade_type_ary[$value['trade_type']];
$setValue['money_in'] = number_format_com($value['money_in']);
$setValue['money_out'] = number_format_com($value['money_out']);
$setValue['money_left'] = number_format_com($value['money_left']);
$lists[] = $setValue;
}
}
$this->data['_title'] = $_title;
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['trade_type_ary'] = $trade_type_ary;
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('appdistribution/team/get_accountlog', true);
}
//设为分销/取消分销
public function edit_team_dealer()
{
$id = $this->input->post('id');
$dealer = $this->input->post('dealer');
$this->mdAppUser->update(array('dealer' => $dealer, 'up_uid' => 0), array('id' => $id));
return $this->show_json(SYS_CODE_SUCCESS, '修改成功!');
}
//展示单条数据
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
}
+256
View File
@@ -0,0 +1,256 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/8/25
* Time: 11:35
*/
class Article extends HD_Controller
{
protected $log_dir;
public function __construct()
{
parent::__construct();
$this->load->model('auto/auto_article_model');
$this->log_dir = "auto_" . get_class($this);
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$statusAry = array(0 => '关闭', 1 => '开启');
$where = array();
if ($params['title']) {
$where["title like '%{$params['title']}%'"] = null;
}
if (strlen($params['status']) > 0) {
$where['status'] = $params['status'];
} else {
$where['status>-1'] = null;
$params['status'] = '';
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$total = $this->auto_article_model->count($where);
$lists = array();
if ($total) {
$orderby = 'id desc';
$select = 'id, title, status';
$rows = $this->auto_article_model->select($where, $orderby, $page, $size, $select);
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
'status' => $v['status'],
'status_name' => $statusAry[$v['status']],
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
$this->data['_title'] = '随车物品管理';
$this->show_view('auto/article/lists', true);
}
public function get()
{
$id = $this->input->get('id');
if ($id) {
$row = $this->auto_article_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['title'],
'status' => $row['status']
);
$title = '编辑随车物品';
$action = 'auto/article/edit';
} else {
$info = array(
'title' => '',
'status' => 1,
);
$title = '新增随车物品';
$action = 'auto/article/add';
}
$statusAry = array(0 => '关闭', 1 => '开启');
$this->data['info'] = $info;
$this->data['statusAry'] = $statusAry;
$this->data['action'] = $action;
$this->data['_title'] = $title;
$this->show_view('auto/article/get');
}
/**
* 新增物品
* @return bool
*/
public function add()
{
$info = $this->input->post('info');
if (!$info['title']) {
return $this->show_json(SYS_CODE_FAIL, '请输入物品名称');
}
$where = array("title" => trim($info['title']));
$old = $this->auto_article_model->get($where);
if ($old && $old['status'] > -1) {
return $this->show_json(SYS_CODE_FAIL, '物品已经存在');
} else if (-1 == $old['status']) {
//旧数据存在,更新
$upd = array('status' => $info['status']);
$ret = $this->auto_article_model->update($upd, array('id' => $old['id']));
if (!$ret) {
debug_log('[error]# update fail; ' . $this->auto_article_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
} else {
$add = array(
'title' => $info['title'],
'status' => $info['status'],
'c_time' => time(),
);
$ret = $this->auto_article_model->add($add);
if (!$ret) {
debug_log('[error]# add fail; ' . $this->auto_article_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
/**
* 编辑
* @return bool
*/
public function edit()
{
$info = $this->input->post('info');
if (!$info['title']) {
return $this->show_json(SYS_CODE_FAIL, '请输入物品名称');
}
$where = array(
"title" => trim($info['title']),
"id<>{$info['id']}" => null,
"status>-1" => null
);
$old = $this->auto_article_model->get($where);
if ($old) {
return $this->show_json(SYS_CODE_FAIL, '物品已经存在');
}
$upd = array('title' => $info['title'], 'status' => $info['status']);
$ret = $this->auto_article_model->update($upd, array('id' => $info['id']));
if (!$ret) {
debug_log('[error]# update fail; ' . $this->auto_article_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
function edit_status()
{
$id = $this->input->post('id');
$stauts = $this->input->post('status');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$where = array('id' => $id);
$this->auto_article_model->update(array('status' => $stauts), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function del()
{
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$where = array('id' => $id);
$ret = $this->auto_article_model->update(array('status' => -1), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
/**
* @return bool
*/
function json_lists()
{
$id = $this->input->post('id');
$title = trim($this->input->post('title'));
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$where = array();
if ($id) {
if (is_numeric($id)) {
$where['id'] = $id;
} else {
if (is_array($id)) {
$id = implode(',', $id);
}
$where["id in ({$id})"] = null;
}
} else {
$title && $where["title like '%{$title}%'"] = null;
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$where['status>-1'] = null;
}
}
$total = $this->auto_article_model->count($where);
$lists = array();
if ($total) {
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->auto_article_model->select($where, $orderby, $page, $size, $select);
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+208
View File
@@ -0,0 +1,208 @@
<?php
/**
* Created by Vim
* User: lcc
* Date: 2020/08/05
* Time: 10:19
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Attr extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
}
public function index(){
$this->lists();
}
public function lists(){
$params = $this->input->get();
$page = $this->input->get('page');
!$page && $page = 1;
$size = 20;
$where["status > -1"] = null;
$params['title'] && $where["title like '%{$params['title']}%'"] = null;
if($params['s_id']){
$where['s_id'] = $params['s_id'];
}if($params['brand_id']){
$where_sery = array('status > -1' => null, 'brand_id' => $params['brand_id']);
$rows_sery = $this->auto_series_model->select($where_sery, 'id desc', 0, 0, 'id');
if($rows_sery){
$sery_ids = array_column($rows_sery, 'id');
$str_ids = implode(',', $sery_ids);
$where["s_id in ({$str_ids})"] = null;
} else {
$where['s_id'] = -1;
}
}
!$params['s_id'] && $params['s_id'] = '';
!$params['brand_id'] && $params['brand_id'] = '';
$count = $this->auto_attr_model->count($where);
$rows = $this->auto_attr_model->select($where, 'id desc', $page, $size);
$type_arr = $this->auto_attr_model->get_type();
$status_arr = $this->auto_brand_model->get_status();
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
$list = [];
if($rows){
$series_arr = array_column($rows,'s_id');
$series_rows = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
foreach($rows as $key=>$val){
$list[] = [
'id' => $val['id'],
'title' => $val['title'],
's_name' => $series_rows[$val['s_id']] ? $series_rows[$val['s_id']][0]['name'] : '',
'status_name' => $status_arr[$val['status']],
'type_cn' => $type_arr[$val['type']],
'c_time' => date('Y-m-d H:i:s',$val['c_time'])
];
}
}
$this->data['lists'] = $list;
$this->data['params'] = $params;
$this->data['brandAry'] = $map_brand;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['_title'] = '属性管理';
$this->show_view('auto/attr/lists', true);
}
public function get(){
$id = $this->input->get('id');
$info = [
'title' => ''
];
if ($id) {
$info = $this->auto_attr_model->get(array('id' => $id));
if (!$info || empty($info)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$info['jsondata'] = json_decode($info['jsondata'],true);
$info['jsondata']['img'] && $info['jsondata']['s_img'] = build_qiniu_image_url($info['jsondata']['img']);
}
$brand_id= '';
if($info['s_id']){
$row_sery = $this->auto_series_model->get(array('id' => $info['s_id']));
$brand_id = $row_sery['brand_id'];
}
$type_arr = $this->auto_attr_model->get_type();
!$info['type'] && $info['type'] = 0;
$info['brand_id'] = $brand_id;
!$info['s_id'] && $info['s_id'] = '';
!$info['jsondata']['img'] && $info['jsondata']['img'] = '';
$this->data['type_arr'] = $type_arr;
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑' : '新增';
return $this->show_view('auto/attr/edit',true);
}
public function add(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$post = $this->input->post();
if (!$post['title']) {
return $this->show_json(SYS_CODE_FAIL, '标题不能为空');
}
$add_data = [
'title' => $post['title'],
's_id' => $post['s_id'],
'type' => $post['type'],
'c_time' => time()
];
$post['jsondata'] && $add_data['jsondata'] = json_encode($post['jsondata'],JSON_UNESCAPED_UNICODE);
$result = $this->auto_attr_model->add($add_data);
if (!$result) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function edit(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$post = $this->input->post();
$row = $this->auto_attr_model->get(['id'=>$post['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '数据不存在');
}
if (!$post['title']) {
return $this->show_json(SYS_CODE_FAIL, '标题不能为空');
}
$update = [
'title' => $post['title'],
's_id' => $post['s_id'],
'type' => $post['type'],
];
$post['jsondata'] && $update['jsondata'] = json_encode($post['jsondata'],JSON_UNESCAPED_UNICODE);
$result = $this->auto_attr_model->update($update,['id'=>$row['id']]);
if (!$result) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
}
public function batch(){
}
public function export(){
}
/**
* 属性选项列表
* @return bool
*/
function json_lists(){
$s_id = $this->input->get_post('s_id');
$status = $this->input->get_post('status');
$type = $this->input->get_post('type');
$page = $this->input->get_post('page');
$size = $this->input->get_post('size');
$where = array();
$s_id && $where['s_id'] = $s_id;
strlen($type) > 0 && $where['type'] = $type;
if(strlen($status) > 0){
$where['status'] = $status;
} else {
$where['status>-1'] = null;
}
$total = $this->auto_attr_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->auto_attr_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+182
View File
@@ -0,0 +1,182 @@
<?php
/**
* Created by Vim
* User: lcc
* Date: 2020/08/04
* Time: 10:19
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Brand extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
}
public function index(){
$this->lists();
}
public function lists(){
$params = $this->input->get();
$page = $this->input->get('page');
!$page && $page = 1;
$size = 20;
$where["status > -1"] = null;
$params['title'] && $where["name like '%{$params['title']}%'"] = null;
$count = $this->auto_brand_model->count($where);
$rows = $this->auto_brand_model->select($where, 'id desc', $page, $size);
$status_arr = $this->auto_brand_model->get_status();
$list = [];
if($rows){
foreach($rows as $key=>$val){
$list[] = [
'id' => $val['id'],
'name' => $val['name'],
'status' => $val['status'],
'status_name' => $status_arr[$val['status']],
'c_time' => date('Y-m-d H:i:s',$val['c_time'])
];
}
}
$this->data['lists'] = $list;
$this->data['params'] = $params;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['_title'] = '品牌列表';
$this->show_view('auto/brand/lists', true);
}
public function get(){
$id = $this->input->get('id');
$info = [];
if ($id) {
$info = $this->auto_brand_model->get(array('id' => $id));
if (!$info || empty($info)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
}
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑品牌' : '新增品牌';
return $this->show_view('auto/brand/edit');
}
public function add(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->post('id');
$name = $this->input->post('name');
$img = $this->input->post('img');
if (!$name || empty($name)) {
return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
}
$old = $this->auto_brand_model->get(['name'=>$name,'status>'=>-1]);
if ($old) {
return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
}
$add_data = array(
'name' => $name,
'logo' => $img,
'c_time' => time()
);
$brand_id = $this->auto_brand_model->add($add_data);
if (!$brand_id) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function edit(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->post('id');
$name = $this->input->post('name');
$img = $this->input->post('img');
$row = $this->auto_brand_model->get(['id' => $id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
if (!$name) {
return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
}
//防止品牌名称重复
$where = array('name' => $name, "status<>-1" => null);
$id && $where['id <>'] = $id;
$old = $this->auto_brand_model->get($where);
if ($old) {
return $this->show_json(SYS_CODE_FAIL, '品牌已经存在');
}
$up_data = array(
'name' => $name,
);
$img && $up_data['logo'] = $img;
$this->auto_brand_model->update($up_data, array('id' => $id));
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$stauts = $this->input->post('status');
$where = array('id' => $id);
$this->auto_brand_model->update(array('status' => $stauts), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function batch(){
}
public function export(){
}
/**
* 获取可选品牌列表
* @return bool
*/
function json_lists(){
$keyword = trim($this->input->post('keyword'));
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$title = trim($this->input->post('title'));
$un_ids = $this->input->post('un_ids');
$where = array();
$keyword && $where['keyword'] = $keyword;
$title && $where["name like '%{$title}%'"] = null;
$un_ids && $where["id not in({$un_ids})"] = null;
if(strlen($status) > 0){
$where['status'] = $status;
} else {
$whre['status > -1'] = null;
}
$total = $this->auto_brand_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, name';
$rows = $this->auto_brand_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'name' => $v['name'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+426
View File
@@ -0,0 +1,426 @@
<?php
/**
* Created by PhpStorm.
* User: lcc
* Date: 2022/2/15
* Time: 15:35
*/
class Business extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_cars_model');
$this->load->model('auto/auto_business_model');
}
public function index()
{
$params = $this->input->get();
$where = array();
if($params['brand_id']){
$where['brand_id'] = $params['brand_id'];
} else{
$params['brand_id'] = '';
}
if($params['s_id']){
$where['s_id'] = $params['s_id'];
} else{
$params['s_id'] = '';
}
if($params['v_id']){
$where['v_id'] = $params['v_id'];
} else{
$params['V_id'] = '';
}
if(strlen($params['status'])){
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
if(strlen($params['if_effect'])){
$where['if_effect'] = $params['if_effect'];
} else {
$params['if_effect'] = '';
}
if($params['city_id']){
$where['city_id'] = $params['city_id'];
} else{
$params['city_id'] = '';
}
if($params['year']){
$where['year'] = $params['year'];
}elseif(!isset($params['year'])){
$where['year'] = $params['year'] = date('Y');
}
if($params['month']){
$where['month'] = $params['month'];
}elseif(!isset($params['month'])){
$where['month'] = $params['month'] = intval(date('m'));
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
//状态
$statusAry = array('0' => '关闭', '1' => '开启');
$total = $this->auto_business_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = '*';
$rows = $this->auto_business_model->select($where, $orderby, $page, $size, $select);
if($rows){
$s_ids = array_unique(array_column($rows,'s_id'));
$attr_ids = array_unique(array_column($rows,'v_id'));
$city_ids = array_unique(array_column($rows,'city_id'));
//获取车系列表
$map_sery = array();
if($s_ids){
$str_ids = implode(',', $s_ids);
$where_sery = array("id in ({$str_ids})" => null);
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
}
$map_attr = array();
if($attr_ids){
$str_ids = implode(',', $attr_ids);
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
}
if($city_ids){
$str_ids = implode(',', $city_ids);
$where_city = array("city_id in ({$str_ids})" => null);
$map_city = $this->sys_city_model->map('city_id', 'name', $where_city, 'id desc', 0 , 0, 'city_id, name');
}
//属性按'车型-车身颜色-内饰颜色'排序
foreach($rows as $v){
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]}";
$city_cn = $map_city[$v['city_id']];
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
$lists[] = array(
'id' => $v['id'],
'title' => $title,
'status' => $v['status'],
'price_car' => $v['price_car'] > 0 ? $v['price_car'] : '0.00',
'price_floor' => $v['price_floor'] > 0 ? $v['price_floor'] : '0.00',
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
'price_color' => $v['price_color'] > 0 ? $v['price_color'] : '0.00',
'profix_car' => $v['profix_car'],
'profix_insure' => $v['profix_insure'],
'profix_carno' => $v['profix_carno'],
'profix_loan' => $v['profix_loan'],
'city_cn'=> $city_cn,
'month' => $month,
's_effect_time' => $v['s_effect_time'] ? date('Y-m-d',$v['s_effect_time']) : '',
'effect_status' => $v['if_effect'] ? '生效中' : '未生效',
'if_effect' => $v['if_effect'],
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['brandAry'] = $map_brand;
$this->data['cityAry'] = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name');
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
$this->data['_title'] = '商务政策管理';
$this->show_view('auto/business/lists',true);
}
public function lists()
{
// TODO: Implement lists() method.
}
public function get()
{
$id = $this->input->get('id');
$map_brand = $this->auto_brand_model->map('id', 'name', ['status>'=>-1], 'id desc', 0 , 0, 'id, name');
$city_rows = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name');
$row = $this->auto_business_model->get(['id'=>$id]);
if($id && $row){
$info = [
'id' => $row['id'],
'city_id' => $row['city_id'],
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'price_car' => $row['price_car'],
'price_floor' => $row['price_floor'],
'price_color' => $row['price_color'],
'price_coplus' => $row['price_coplus'],
'profix_car' => $row['profix_car'],
'profix_carno' => $row['profix_carno'],
'profix_insure' => $row['profix_insure'],
'profix_loan' => $row['profix_loan'],
'delivery_day' => $row['delivery_day'],
'date' => date('Y-m',strtotime("{$row['year']}-{$row['month']}")),
'year' => $row['year'],
'month' => intval($row['month']),
'colors' => json_decode($row['colors'],true),
's_effect_time' => $row['s_effect_time'] ? date('Y-m-d',$row['s_effect_time']) : '',
'action' => 'auto/business/edit',
];
if($this->input->get('type')=='copy'){ //复制
$info['month'] = intval(date('m'));
$info['action'] = 'auto/business/add';
$info['s_effect_time'] = date('Y-m-d');
}
}else{
$info = [
'city_id' => '',
'brand_id' => '',
's_id' => '',
'v_id' => '',
'price_car' => 0.00,
'price_floor' => 0.00,
'price_color' => 0.00,
'price_coplus' => 0.00,
'profix_car' => 0.00,
'profix_carno' => 0.00,
'profix_insure' => 0.00,
'profix_loan' => 0.00,
'delivery_day' => 0,
'action' => 'auto/business/add',
'year' => date('Y'),
'month' => intval(date('m')),
's_effect_time' => date('Y-m-d'),
'colors' => []
];
}
$this->data['info'] = $info;
$this->data['brandAry'] = $map_brand;
$this->data['city_rows'] = $city_rows;
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['_title'] = '添加';
$this->show_view('auto/business/get');
}
public function add()
{
$info = $this->input->post('info');
$res = $this->valid_data($info);
if(!$res['code']){
return $this->show_json(SYS_CODE_FAIL,$res['msg']);
}
$year = $info['year'];
$month = intval($info['month']);
$where = [
'brand_id' => $info['brand_id'],
's_id' => $info['s_id'],
'v_id' => $info['v_id'],
'city_id' => $info['city_id'],
'year' => $year,
'month' => $month,
'status'=>1
];
if($this->auto_business_model->get($where)){
return $this->show_json(SYS_CODE_FAIL, '数据已存在');
}
$data = [
'brand_id' => $info['brand_id'],
's_id' => $info['s_id'],
'v_id' => $info['v_id'],
'city_id' => $info['city_id'],
'year' => $year,
'month' => $month,
'status' => 1,
'c_time' => time()
];
$info['price_car'] && $data['price_car'] = $info['price_car'];
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
$info['price_color'] && $data['price_color'] = $info['price_color'];
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
$info['profix_insure'] && $data['profix_insure'] = $info['profix_insure'];
$info['profix_loan'] && $data['profix_loan'] = $info['profix_loan'];
$info['colors'] && $data['colors'] = json_encode($info['colors'],JSON_UNESCAPED_UNICODE);
$info['s_effect_time'] && $data['s_effect_time'] = strtotime($info['s_effect_time']);
$info['delivery_day'] && $data['delivery_day'] = $info['delivery_day'];
if(time()>$data['s_effect_time']){
$data['if_effect'] = 1;
}
$this->auto_business_model->add($data);
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function edit()
{
$info = $this->input->post('info');
if(!$this->auto_business_model->get(['id'=>$info['id']])){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$res = $this->valid_data($info);
if(!$res['code']){
return $this->show_json(SYS_CODE_FAIL,$res['msg']);
}
$year = $info['year'];
$month = intval($info['month']);
$where = [
'brand_id' => $info['brand_id'],
's_id' => $info['s_id'],
'v_id' => $info['v_id'],
'city_id' => $info['city_id'],
'year' => $year,
'month' => $month,
'status'=>1,
'id !=' => $info['id']
];
if($this->auto_business_model->get($where)){
return $this->show_json(SYS_CODE_FAIL, '数据已存在');
}
$data = [
'city_id' => $info['city_id'],
'brand_id' => $info['brand_id'],
's_id' => $info['s_id'],
'v_id' => $info['v_id'],
'year' => $year,
'month' => $month,
];
$info['price_car'] && $data['price_car'] = $info['price_car'];
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
$info['price_color'] && $data['price_color'] = $info['price_color'];
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
$info['profix_insure'] && $data['profix_insure'] = $info['profix_insure'];
$info['profix_loan'] && $data['profix_loan'] = $info['profix_loan'];
$info['colors'] && $data['colors'] = json_encode($info['colors'],JSON_UNESCAPED_UNICODE);
$info['s_effect_time'] && $data['s_effect_time'] = strtotime($info['s_effect_time']);
$info['delivery_day'] && $data['delivery_day'] = $info['delivery_day'];
if(time()>$data['s_effect_time']){
$data['if_effect'] = 1;
}
$this->auto_business_model->update($data,['id'=>$info['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del()
{
// TODO: Implement del() method.
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
function edit_status(){
$id = $this->input->post('id');
$field = $this->input->post('field');
$value = $this->input->post('value');
$status = $this->input->post('status');
$upd = [];
if('status' == $field){
$status = $value;
$upd = array('status' => $status);
}
if($field == 'if_effect'){
$upd['if_effect'] = $value;
if($value){ //生效
$row = $this->auto_business_model->get(['id'=>$id]);
$where = [
'city_id' => $row['city_id'],
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'status' => 1,
's_effect_time>' => $row['s_effect_time'],
];
if($this->auto_business_model->count($where)){
return $this->show_json(SYS_CODE_FAIL, '存在更新生效设置');
}
unset($where['s_effect_time']);
$this->auto_business_model->update(['if_effect'=>0],$where);
}
}
if(is_numeric($id)){
$where = array('id' => $id);
} else {
$where = array("id in ({$id})" => null);
}
$ret = $this->auto_business_model->update($upd, $where);
if(!$ret){
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function add_copy(){
$id = $this->input->post('id');
$row = $this->auto_business_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$year = date('Y');
$month = date('m');
$where = [
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'city_id' => $row['city_id'],
'year' => $year,
'month' => $month,
'status>='=>0
];
if($this->auto_business_model->get($where)){
return $this->show_json(SYS_CODE_FAIL, '本月该数据已存在');
}
$data = [
'city_id' => $row['city_id'],
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'year' => $year,
'month' => $month,
'status' => 1,
'c_time' => time()
];
$row['price_car'] && $data['price_car'] = $row['price_car'];
$row['price_floor'] && $data['price_floor'] = $row['price_floor'];
$row['price_coplus'] && $data['price_coplus'] = $row['price_coplus'];
$row['price_color'] && $data['price_color'] = $row['price_color'];
$this->auto_business_model->add($data);
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
private function valid_data($info){
if(!$info['brand_id']){
return ['code'=>0,'msg'=>'请选择品牌'];
}
if(!$info['s_id']){
return ['code'=>0,'msg'=>'请选择车系'];
}
if(!$info['v_id']){
return ['code'=>0,'msg'=>'请选择车型'];
}
if(!$info['city_id']){
return ['code'=>0,'msg'=>'请选择城市'];
}
return ['code'=>1,'msg'=>'验证成功'];
}
}
+380
View File
@@ -0,0 +1,380 @@
<?php
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/8/6
* Time: 11:15
*/
class Cars extends HD_Controller{
protected $log_dir;
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_cars_model');
$this->log_dir = "auto_" . get_class($this);
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
$where = array();
if($params['brand_id']){
$where['brand_id'] = $params['brand_id'];
} else{
$params['brand_id'] = '';
}
if($params['s_id']){
$where['s_id'] = $params['s_id'];
} else{
$params['s_id'] = '';
}
if($params['v_id']){
$where['v_id'] = $params['v_id'];
} else{
$params['V_id'] = '';
}
if(strlen($params['status']) > 0){
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
//状态
$statusAry = array('0' => '关闭', '1' => '开启');
$total = $this->auto_cars_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = '*';
$rows = $this->auto_cars_model->select($where, $orderby, $page, $size, $select);
if($rows){
$s_ids = array_unique(array_column($rows,'s_id'));
$attr_ids = array_unique(array_column($rows,'v_id'));
//获取车系列表
$map_sery = array();
if($s_ids){
$str_ids = implode(',', $s_ids);
$where_sery = array("id in ({$str_ids})" => null);
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
}
$map_attr = array();
if($attr_ids){
$str_ids = implode(',', $attr_ids);
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
}
//属性按'车型-车身颜色-内饰颜色'排序
foreach($rows as $v){
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]}";
$lists[] = array(
'id' => $v['id'],
'title' => $title,
'status' => $v['status'],
'price_car' => $v['price_car'] > 0 ? $v['price_car'] : '0.00',
'price_floor' => $v['price_floor'] > 0 ? $v['price_floor'] : '0.00',
'price_book' => $v['price_book'] > 0 ? $v['price_book'] : '0.00',
'price_insure' => $v['price_insure'] > 0 ? $v['price_insure'] : '0.00',
'price_fine' => $v['price_fine'] > 0 ? $v['price_fine'] : '0.00',
'price_fine_floor' => $v['price_fine_floor'] > 0 ? $v['price_fine_floor'] : '0.00',
'price_finance' => $v['price_finance'] > 0 ? $v['price_finance'] : '0.00',
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
'brokerage_1' => $v['brokerage_1'] > 0 ? $v['brokerage_1'] : '0.00',
'brokerage_2' => $v['brokerage_2'] > 0 ? $v['brokerage_2'] : '0.00',
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['brandAry'] = $map_brand;
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
$this->data['_title'] = '车型库管理';
$this->show_view('auto/cars/lists',true);
}
public function get(){
$id = $this->input->get('id');
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
//状态
$statusAry = array('0' => '关闭', '1' => '开启');
if($id){
$row = $this->auto_cars_model->get(array('id' => $id));
//获取属性列表
$attr_ids = array();
$row['v_id'] && $attr_ids[] = $row['v_id'];
$row['cor_id'] && $attr_ids[] = $row['cor_id'];
$row['incor_id'] && $attr_ids[] = $row['incor_id'];
$str_ids = implode(',', $attr_ids);
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title');
$attr = "{$map_attr[$row['v_id']]}-{$map_attr[$row['cor_id']]}-{$map_attr[$row['incor_id']]}(内饰)";
//车系
$row_sery = $this->auto_series_model->get(array('id' => $row['s_id']));
$info = array(
'id' => $row['id'],
'brand_name' => $map_brand[$row['brand_id']],
'sery_name' => $row_sery['name'],
'attr' => $attr,
'price_car' => $row['price_car'] > 0 ? $row['price_car'] : '',
'price_floor' => $row['price_floor'] > 0 ? $row['price_floor'] : '',
'price_book' => $row['price_book'] > 0 ? $row['price_book'] : '',
'price_insure' => $row['price_insure'] > 0 ? $row['price_insure'] : '',
'price_fine' => $row['price_fine'] > 0 ? $row['price_fine'] : '',
'price_finance' => $row['price_finance'] > 0 ? $row['price_finance'] : '',
'price_coplus' => $row['price_coplus'] > 0 ? $row['price_coplus'] : '',
'brokerage_1' => $row['brokerage_1'] > 0 ? $row['brokerage_1'] : '',
'brokerage_2' => $row['brokerage_2'] > 0 ? $row['brokerage_2'] : '',
'status' => $row['status'],
);
$title = '编辑车型库';
$view = 'auto/cars/get';
} else {
//新增车型库
$info = array('brand_id' => '', 's_id' => '');
$title = '新增车型库';
$view = 'auto/cars/add';
}
$this->data['info'] = $info;
$this->data['statusAry'] = $statusAry;
$this->data['brandAry'] = $map_brand;
$this->data['_title'] = $title;
$this->show_view($view);
}
public function add(){
$info = $this->input->post('info');
$brand_id = $info['brand_id'];
$s_id = $info['s_id'];
$where = array('s_id' => $s_id,'type'=>1);
$orderby = 'type asc, id asc';
$select = 'id,type';
$map = $this->auto_attr_model->map('type', '', $where, $orderby, 0, 0, $select);
$count = count($map);
if(!$count){
return $this->show_json(SYS_CODE_FAIL, '该车系暂无属性!');
}
$attrs = array();//属性组合 0车身颜色,1车型,2内饰颜色
foreach($map as $i => $arr){
$arr1 = $attrs;
$attrs = array();
foreach($arr as $v){
if($arr1){
foreach($arr1 as $v1){
$v1[$i] = $v['id'];
$attrs[] = $v1;
}
} else {
$attrs[] = array($i => $v['id']);
}
}
}
//车型库现有数据
$where = array('s_id' => $s_id);
$rows_car = $this->auto_cars_model->select($where, 'id desc', 0, 0, 'id, v_id, cor_id, incor_id');
$map_cars = array();
foreach($rows_car as $v){
$k = "{$v['v_id']}";
$map_cars[$k] = $v;
}
$adds = array();
foreach($attrs as $attr){
$v_id = $attr[1] ? $attr[1] : 0;//1-车型
$k = "{$v_id}";
if($map_cars[$k]){
$map_cars[$k]['ok'] = 1;//保留
} else {
$adds[] = array(
'brand_id' => $brand_id,
's_id' => $s_id,
'v_id' => $v_id,
'status' => 1,
'c_time' => time()
);
}
}
//获取需要删除的车型库
$del_ids = array();
foreach($map_cars as $v){
if(!$v['ok']){
$del_ids[] = $v['id'];
}
}
//删除旧库
if($del_ids){
$str_ids = implode(',', $del_ids);
$where = array("id in ({$str_ids})" => null);
$ret = $this->auto_cars_model->delete($where);
if(!$ret){
debug_log("[error]#" . $this->auto_cars_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '更新失败!');
}
}
//新增库
if($adds){
$ret = $this->auto_cars_model->add_batch($adds);
if(!$ret){
debug_log("[error]#" . $this->auto_cars_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '更新失败!');
}
}
return $this->show_json(SYS_CODE_SUCCESS, '更新成功!');
}
public function edit(){
$info = $this->input->post('info');
$upd = array(
'price_car' => floatval($info['price_car']),
'price_floor' => floatval($info['price_floor']),
'price_book' => floatval($info['price_book']),
'price_insure' => floatval($info['price_insure']),
'price_fine' => floatval($info['price_fine']),
'price_fine_floor' => floatval($info['price_fine_floor']),
'price_finance' => floatval($info['price_finance']),
'price_coplus' => floatval($info['price_coplus']),
'brokerage_1' => floatval($info['brokerage_1']),
'brokerage_2' => floatval($info['brokerage_2']),
);
$where = array('id' => $info['id']);
$ret = $this->auto_cars_model->update($upd, $where);
if(!$ret){
debug_log("[error]#" . $this->auto_cars_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '更新失败!');
}
return $this->show_json(SYS_CODE_SUCCESS, '更新成功!');
}
function edit_status(){
$id = $this->input->post('id');
$field = $this->input->post('field');
$value = $this->input->post('value');
$status = $this->input->post('status');
if('status' == $field){
$status = $value;
}
$upd = array('status' => $status);
if(is_numeric($id)){
$where = array('id' => $id);
} else {
$where = array("id in ({$id})" => null);
}
$ret = $this->auto_cars_model->update($upd, $where);
if(!$ret){
debug_log("[error]# " . $this->auto_cars_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
// TODO: Implement del() method.
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
/**
* 获取车型库信息
* @return bool
*/
function json_get(){
$brand_id = $this->input->get_post('brand_id');
$s_id = $this->input->get_post('s_id');
$v_id = $this->input->get_post('v_id');
$cor_id = $this->input->get_post('cor_id');
$incor_id = $this->input->get_post('incor_id');
$where = array(
'status' => 1,
'brand_id' => $brand_id,
's_id' => $s_id,
'v_id' => $v_id,
);
$row = $this->auto_cars_model->get($where);
// $data = array(
// 'id' => $row['id'],
// 'price_car' => $row['price_car']
// );
$this->data = $row;
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* 旧数据attrs转存新字段
*/
function json_transfer(){
$where = array('v_id' => 0, 'cor_id' => 0, 'incor_id' => 0);
$total = $this->auto_cars_model->count($where);
$rows = $this->auto_cars_model->select($where, 'id asc', 1, 100, 'id, attrs');
$count = count($rows);
$done = 0;
foreach($rows as $v){
$attr_ids = str_replace('_', ',', $v['attrs']);
if($attr_ids){
$where = array("id in({$attr_ids})" => null);
$map_attr = $this->auto_attr_model->map('type', 'id', $where, 'id desc', 0, 0, 'id, type');
$upd = array();
$map_attr[0] && $upd['cor_id'] = $map_attr[0];
$map_attr[1] && $upd['v_id'] = $map_attr[1];
$map_attr[2] && $upd['incor_id'] = $map_attr[2];
if($upd){
$ret = $this->auto_cars_model->update($upd, array('id' => $v['id']));
$ret && $done++;
}
}
}
exit("total:{$total}; count:{$count}; done:{$done};");
}
}
+251
View File
@@ -0,0 +1,251 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by Vim
* User: lcc
* Date: 2021/09/06
* Time: 10:19
*/
class Finance extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_cars_model');
$this->load->model('auto/auto_finance_model');
$this->load->model('sys/sys_finance_model');
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
!strlen($params['status']) && $params['status'] = '';
!$params['brand_id'] && $params['brand_id'] = '';
!$params['s_id'] && $params['s_id'] = '';
$page = $params['page'];
$size = $params['size'];
$page = !$page ? 1 : $page;
$size = !$size ? 20 : $size;
$where = [];
$t1 = 'lc_auto_car_finance';
$t2 = 'lc_auto_cars';
strlen($params['status']) && $where["$t1.status"] = $params['status'];
$params['brand_id'] && $where["$t2.brand_id"] = $params['brand_id'];
$params['s_id'] && $where["$t2.s_id"] = $params['s_id'];
$params['v_id'] && $where["$t2.v_id"] = $params['v_id'];
$params['cor_id'] && $where["$t2.cor_id"] = $params['cor_id'];
$total = $this->auto_finance_model->count_finance($where);
$lists = array();
if($total){
$select = "$t1.id,$t1.car_id,$t1.fin_id,$t1.num,$t1.month_pay,$t1.first_pay,$t1.srv_pay,$t1.status";
$rows = $this->auto_finance_model->select_finance($where, 'id desc', $page, $size, $select);
$fin_id_arr = array_column($rows,'fin_id');
$fin_rows = $this->sys_finance_model->get_map_by_ids($fin_id_arr,'id,title');
foreach($rows as $key=>$val){
$lists[] = [
'id' => $val['id'],
'car' => $this->auto_cars_model->get_title($val['car_id']),
'fin_name' => $fin_rows[$val['fin_id']] ? $fin_rows[$val['fin_id']][0]['title'] : '',
'num' => $val['num'],
'month_pay' => $val['month_pay'],
'first_pay' => $val['first_pay'],
'srv_pay' => $val['srv_pay'],
'status' => $val['status']
];
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $this->auto_finance_model->status_ary();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
$this->data['_title'] = '车型金融产品管理';
$this->show_view('auto/finance/lists',true);
}
public function get(){
$info = [];
$id = $this->input->get('id');
$row = $this->auto_finance_model->get(['id'=>$id]);
$action = 'auto/finance/add';
if($row){
$car_row = $this->auto_cars_model->get(['id'=>$row['car_id']],'brand_id,s_id,v_id');
$action = 'auto/finance/edit';
$info['id'] = $row['id'];
$info['car_id'] = $row['car_id'];
$info['brand_id'] = $car_row['brand_id'];
$info['s_id'] = $car_row['s_id'];
$info['v_id'] = $car_row['v_id'];
$info['fin_id'] = $row['fin_id'];
$info['num'] = $row['num'];
$info['first_pay'] = $row['first_pay'];
$info['month_pay'] = $row['month_pay'];
$info['srv_pay'] = $row['srv_pay'];
$info['status'] = $row['status'];
}
$nums = $this->auto_finance_model->get_nums();
$finance = $this->sys_finance_model->select(['status'=>1],'id desc',1,20,'id,title');
!$info['fin_id'] && $info['fin_id'] = $finance[0]['id'];
!$info['num'] && $info['num'] = $nums[0];
!isset($info['status']) && $info['status'] = 1;
!$info['brand_id'] && $info['brand_id'] = 0;
!$info['s_id'] && $info['s_id'] = 0;
!$info['v_id'] && $info['v_id'] = 0;
$this->data['action'] = $action;
$this->data['finance'] = $finance;
$this->data['statusAry'] = $this->auto_finance_model->status_ary();
$this->data['nums'] = $nums;
$this->data['info'] = $info;
$this->show_view('auto/finance/get');
}
public function add(){
$info = $this->input->post('info');
if(!$info['car_id']){
return $this->show_json(SYS_CODE_FAIL, '请选择具体车辆!');
}
if(!$info['first_pay'] || !$info['month_pay'] || !$info['srv_pay'] ||!$info['num']){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$row = $this->auto_finance_model->get(['car_id'=>$info['car_id'],'num'=>$info['num'],'fin_id'=>$info['fin_id']]);
if($row){
$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}金融-{$info['num']}");
}
$adata = [
'car_id' => $info['car_id'],
'fin_id' => $info['fin_id'],
'first_pay' => $info['first_pay'],
'month_pay' => $info['month_pay'],
'srv_pay' => $info['srv_pay'],
'num' => $info['num'],
'c_time' => time()
];
!$info['status'] && $adata['status'] = 0;
$res = $this->auto_finance_model->add($adata);
if(!$res){
return $this->show_json(SYS_CODE_FAIL, '添加失败!');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功!');
}
public function edit(){
$info = $this->input->post('info');
$row = $this->auto_finance_model->get(['id'=>$info['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if(!$info['car_id']){
return $this->show_json(SYS_CODE_FAIL, '请选择具体车辆!');
}
if(!$info['first_pay'] || !$info['month_pay'] || !$info['srv_pay'] ||!$info['num']){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$row = $this->auto_finance_model->get(['car_id'=>$info['car_id'],'num'=>$info['num'],'fin_id'=>$info['fin_id'],'id !='=>$info['id']]);
if($row){
$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}金融-{$info['num']}");
}
$adata = [
'car_id' => $info['car_id'],
'fin_id' => $info['fin_id'],
'first_pay' => $info['first_pay'],
'month_pay' => $info['month_pay'],
'srv_pay' => $info['srv_pay'],
'num' => $info['num'],
'c_time' => time()
];
!$info['status'] && $adata['status'] = 0;
$res = $this->auto_finance_model->update($adata,['id'=>$info['id']]);
if(!$res){
return $this->show_json(SYS_CODE_FAIL, '更新失败!');
}
return $this->show_json(SYS_CODE_SUCCESS, '更新成功!');
}
public function del(){
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
public function get_cars(){
$brand_id = $this->input->get('brand_id');
$s_id = $this->input->get('s_id');
$v_id = $this->input->get('v_id');
$t1 = 'lc_auto_cars';
$t2 = 'lc_auto_brand';
$t3 = 'lc_auto_series';
$where = [
"$t1.status" => 1
];
$brand_id && $where["$t1.brand_id"] = $brand_id;
$s_id && $where["$t1.s_id"] = $s_id;
$v_id && $where["$t1.v_id"] = $v_id;
$count = $this->auto_cars_model->select_car($where,'',0,0,'',1);
$lists = [];
$size = $page = 0;
if($count){
$fileds = "$t1.id,$t1.v_id,$t1.cor_id,$t1.incor_id,$t2.name as b_name,$t3.name as s_name";
$rows = $this->auto_cars_model->select_car($where,'id desc',$page,$size,$fileds);
$v_id_arr = array_column($rows,'v_id');
$cor_id_arr = array_column($rows,'cor_id');
$incor_id_arr = array_column($rows,'incor_id');
$attr_id_arr = array_unique(array_merge($v_id_arr,$cor_id_arr,$incor_id_arr));
$attrs = $this->auto_attr_model->get_map_by_ids($attr_id_arr,'id,title');
foreach($rows as $key => $val){
$lists[] = [
'id' => $val['id'],
'b_name' => $val['b_name'],
's_name' => $val['s_name'],
'v_name' => $attrs[$val['v_id']] ? $attrs[$val['v_id']][0]['title'] : '',
'cor_name' => $attrs[$val['cor_id']] ? $attrs[$val['cor_id']][0]['title'] : '',
'incor_name' => $attrs[$val['incor_id']] ? $attrs[$val['incor_id']][0]['title'] : '',
];
}
}
$this->data['lists'] = $lists;
return $this->show_json(SYS_CODE_SUCCESS);
}
function edit_status(){
$id = $this->input->post('id');
$field = $this->input->post('field');
$value = $this->input->post('value');
$status = $this->input->post('status');
if('status' == $field){
$status = $value;
}
$upd = array('status' => $status);
if(is_numeric($id)){
$where = array('id' => $id);
} else {
$where = array("id in ({$id})" => null);
}
$ret = $this->auto_finance_model->update($upd, $where);
if(!$ret){
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
}
+243
View File
@@ -0,0 +1,243 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/8/25
* Time: 11:35
*/
class Fine extends HD_Controller{
protected $log_dir;
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_fine_model');
$this->log_dir = "auto_" . get_class($this);
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
$statusAry = array(0 => '关闭', 1 => '开启');
$where = array();
if($params['title']){
$where["title like '%{$params['title']}%'"] = null;
}
if(strlen($params['status']) > 0){
$where['status'] = $params['status'];
} else{
$where['status>-1'] = null;
$params['status'] = '';
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$total = $this->auto_fine_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title, status';
$rows = $this->auto_fine_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
'status' => $v['status'],
'status_name' => $statusAry[$v['status']],
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
$this->data['_title'] = '车辆精品管理';
$this->show_view('auto/fine/lists',true);
}
public function get(){
$id = $this->input->get('id');
if($id){
$row = $this->auto_fine_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['title'],
'status' => $row['status']
);
$title = '编辑车辆精品';
$action = 'auto/fine/edit';
} else {
$info = array(
'title' => '',
'status' => 1,
);
$title = '新增车辆精品';
$action = 'auto/fine/add';
}
$statusAry = array(0 => '关闭', 1 => '开启');
$this->data['info'] = $info;
$this->data['statusAry'] = $statusAry;
$this->data['action'] = $action;
$this->data['_title'] = $title;
$this->show_view('auto/fine/get');
}
/**
* 新增精品
* @return bool
*/
public function add(){
$info = $this->input->post('info');
if(!$info['title']){
return $this->show_json(SYS_CODE_FAIL, '请输入精品名称');
}
$where = array("title" => trim($info['title']));
$old = $this->auto_fine_model->get($where);
if($old && $old['status'] > -1){
return $this->show_json(SYS_CODE_FAIL, '精品已经存在');
} else if(-1 == $old['status']) {
//旧数据存在,更新
$upd = array('status' => $info['status']);
$ret = $this->auto_fine_model->update($upd, array('id' => $old['id']));
if(!$ret){
debug_log('[error]# update fail; ' . $this->auto_fine_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
} else {
$add = array(
'title' => $info['title'],
'status' => $info['status'],
'c_time' => time(),
);
$ret = $this->auto_fine_model->add($add);
if(!$ret){
debug_log('[error]# add fail; ' . $this->auto_fine_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
/**
* 编辑
* @return bool
*/
public function edit(){
$info = $this->input->post('info');
if(!$info['title']){
return $this->show_json(SYS_CODE_FAIL, '请输入精品名称');
}
$where = array(
"title" => trim($info['title']),
"id<>{$info['id']}" => null,
"status>-1" => null
);
$old = $this->auto_fine_model->get($where);
if($old){
return $this->show_json(SYS_CODE_FAIL, '精品已经存在');
}
$upd = array('title' => $info['title'], 'status' => $info['status']);
$ret = $this->auto_fine_model->update($upd, array('id' => $info['id']));
if(!$ret){
debug_log('[error]# update fail; ' . $this->auto_fine_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
function edit_status(){
$id = $this->input->post('id');
$stauts = $this->input->post('status');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$where = array('id' => $id);
$this->auto_fine_model->update(array('status' => $stauts), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function del(){
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$where = array('id' => $id);
$ret = $this->auto_fine_model->update(array('status' => -1), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
/**
* @return bool
*/
function json_lists(){
$id = $this->input->post('id');
$title = trim($this->input->post('title'));
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$where = array();
if($id){
if(is_numeric($id)){
$where['id'] = $id;
} else {
if(is_array($id)){
$id = implode(',', $id);
}
$where["id in ({$id})"] = null;
}
} else {
$title && $where["title like '%{$title}%'"] = null;
if(strlen($status) > 0){
$where['status'] = $status;
} else {
$where['status>-1'] = null;
}
}
$total = $this->auto_fine_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->auto_fine_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+307
View File
@@ -0,0 +1,307 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:车型介绍
* Created on: 2022/3/18 10:31
* Created by: dengbw
*/
class Introduce extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('auto/auto_introduce_model', 'mdAutoIntroduce');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
}
//首页信息
public function index()
{
return $this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$statusAry = $this->mdAutoIntroduce->statusAry();
$lists = array();
$where = ["status<>-1" => null];
if (strlen($params['status'])) {
$where['status'] = $params['status'];
}
$count = $this->mdAutoIntroduce->count($where);
if ($count) {
$res = $this->mdAutoIntroduce->select($where, "id desc", $params['page'], $params['size']);
$map_brand = $map_series = [];
$brand_ids = array_unique(array_column($res, 'brand_id'));
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
}
$s_ids = array_unique(array_column($res, 's_id'));
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$map_series = $this->mdAutoSeries->map('id', 'name', ["id in ({$str_ids})" => null]);
}
foreach ($res as $key => $value) {
$brand_name = $map_brand[$value['brand_id']];
$s_name = $map_series[$value['s_id']];
$lists[] = [
'id' => $value['id'],
'title' => "{$brand_name}-{$s_name}",
'status' => $value['status'],
'status_name' => $statusAry[$value['status']],
'c_time' => date('Y-m-d', $value['c_time']),
];
}
}
$brandList = $this->mdAutoBrand->select(["status<>" => -1], 'id desc', 0, 0, 'id, name');
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['showInfo'] = ['statusAry' => $statusAry, 'brandList' => $brandList];
$this->data['_title'] = '车型介绍列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/auto/introduce/lists', true);
}
//物料列表
public function lists_material()
{
$params = $this->input->post();
if (!$params['biz_id'] || !$params['introduces']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$list = [];
$introduces_ids = array_unique(array_column($params['introduces'], 'id'));
$str_ids = implode(',', $introduces_ids);
$res = $this->mdAutoIntroduce->select(["id in({$str_ids})" => null], "id desc", 0, 0);
$map_brand = $map_series = [];
$brand_ids = array_unique(array_column($res, 'brand_id'));
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
}
$s_ids = array_unique(array_column($res, 's_id'));
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$map_series = $this->mdAutoSeries->map('id', 'name', ["id in ({$str_ids})" => null]);
}
foreach ($res as $key => $value) {
$brand_name = $map_brand[$value['brand_id']];
$s_name = $map_series[$value['s_id']];
$title = "{$brand_name}-{$s_name}";
$scene = "{$value['id']}_{$params['biz_id']}";
$page = 'pages/modelShow/index';
$name = $params['biz_name'] . '_' . $title;
//$name && $name = preg_replace('# #', '', $name);//正则去除所有空格
$qr_code = $this->qrcode($scene, $page, '1280px', $name);
$list[] = [
'title' => $title,
'url' => "{$page}?id={$scene}",
'qr_code' => $qr_code['url'] ? $qr_code['url'] : '',
];
}
$this->data['list'] = $list;
return $this->show_json(SYS_CODE_SUCCESS, '物料列表!');
}
//展示单条数据
public function get()
{
$id = intval($this->input->get('id'));
if ($id) {
$re = $this->mdAutoIntroduce->get(['id' => $id]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '车型不存在!');
}
$video = $re['video'] ? build_qiniu_image_url($re['video'], 0, 0, 'video') : '';
$info = array(
'id' => $re['id'],
'brand_id' => $re['brand_id'],
's_id' => $re['s_id'],
'video_file_url' => $re['video'],
'video' => $video,
'video_cover' => $video . '?vframe/jpg/offset/1',
'content' => $re['content'],
);
$title = '请选择车型';
if ($re['s_id']) {
$re_b = $this->mdAutoBrand->get(['id' => $re['brand_id']]);
$re_b && $title = $re_b['name'];
$re_s = $this->mdAutoSeries->get(['id' => $re['s_id']]);
$re_s && $title = $title ? $title . '-' . $re_s['name'] : $title;
}
$_title = '编辑车型介绍';
$showInfo = ['title' => $title, 'url' => '/auto/introduce/edit'];
} else {
$_title = '新增车型介绍';
$info = array(
'brand_id' => 0,
's_id' => 0,
'video_file_url' => '',
'video' => '',
'video_cover' => '',
'content' => '',
);
$showInfo = ['title' => '请选择车型', 'url' => '/auto/introduce/add'];
}
$showInfo['brandList'] = $this->mdAutoBrand->select(["status<>-1" => null], 'id desc', 0, 0, 'id, name');
$this->data['_title'] = $_title;
$this->data['info'] = $info;
$this->data['showInfo'] = $showInfo;
return $this->show_view('/auto/introduce/edit', true);
}
//添加单条数据
public function add()
{
$params = $this->input->post();
$info = $params['info'];
if (!$info) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$info['brand_id'] || !$info['s_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型!');
}
if (!$info['video_file_url'] && !$info['video']) {
return $this->show_json(SYS_CODE_FAIL, '请上传视频!');
}
$re = $this->mdAutoIntroduce->get(array('brand_id' => $info['brand_id'], 's_id' => $info['s_id']));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '车型已存在了!');
}
$video = $info['video_file_url'] ? $info['video_file_url'] : $info['video'];
$this->mdAutoIntroduce->add(['brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'video' => $video
, 'content' => $info['content'], 'c_time' => time()]);
return $this->show_json(SYS_CODE_SUCCESS, '新增成功', '/auto/introduce');
}
//编辑单条数据
public function edit()
{
$params = $this->input->post();
$info = $params['info'];
if (!$info) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$info['brand_id'] || !$info['s_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型!');
}
if (!$info['video_file_url']) {
return $this->show_json(SYS_CODE_FAIL, '请上传视频!');
}
$re = $this->mdAutoIntroduce->get(array('brand_id' => $info['brand_id'], 's_id' => $info['s_id']));
if ($re && $re['id'] != $info['id']) {
return $this->show_json(SYS_CODE_FAIL, '车型已存在了!');
}
$this->mdAutoIntroduce->update(['brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'content' => $info['content']
, 'video' => $info['video_file_url']], ['id' => $info['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status()
{
$id = $this->input->post('id');
$stauts = intval($this->input->post('status'));
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->mdAutoIntroduce->update(['status' => $stauts], ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//删除单条数据
public function del()
{
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->mdAutoIntroduce->update(['status' => '-1'], ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
private function qrcode($scene, $page = '', $width = 0, $name = '')
{
$path = "{$page}?{$scene}";
$width && $path .= "{$width}";
$this->load->model('app/app_model', 'mdApp');
$wxconfig = $this->mdApp->appConfig()[1]['wx'];
//$filename = "{$this->mdApp->appConfig()[1]['app_key']}/" . substr(md5($path), 8, 16);
$filename = "{$this->mdApp->appConfig()[1]['app_key']}/{$name}";
$this->load->library('hdwechat', $wxconfig);
$result = $this->hdwechat->qrcode($filename, $scene, $page, $width);
if (!$result) {
return ['url' => ''];
}
$data = array('url' => http_host_com() . '/' . $result['url']);
return $data;
}
/**
* Notes:
* Created on: 2022/3/21 16:16
* Created by: dengbw
* @return bool
*/
function json_lists()
{
$page = $this->input->post('page');
$size = $this->input->post('size');
$status = $this->input->post('status');
$brand_id = intval($this->input->post('brand_id'));
$where = array();
$brand_id && $where["brand_id"] = $brand_id;
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$where['status > -1'] = null;
}
$total = $this->mdAutoIntroduce->count($where);
$lists = array();
if ($total) {
$orderby = 'id desc';
$select = 'id,brand_id, s_id';
$res = $this->mdAutoIntroduce->select($where, $orderby, $page, $size, $select);
$map_brand = $map_series = [];
$brand_ids = array_unique(array_column($res, 'brand_id'));
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
}
$s_ids = array_unique(array_column($res, 's_id'));
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$map_series = $this->mdAutoSeries->map('id', 'name', ["id in ({$str_ids})" => null]);
}
foreach ($res as $v) {
$brand_name = $map_brand[$v['brand_id']];
$s_name = $map_series[$v['s_id']];
$lists[] = array(
'id' => $v['id'],
'name' => "{$brand_name}-{$s_name}",
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+187
View File
@@ -0,0 +1,187 @@
<?php
/**
* Created by Vim
* User: lcc
* Date: 2020/08/05
* Time: 10:19
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Series extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
}
public function index(){
$this->lists();
}
public function lists(){
$params = $this->input->get();
$page = $this->input->get('page');
!$page && $page = 1;
$size = 20;
$where["status > -1"] = null;
$params['title'] && $where["name like '%{$params['title']}%'"] = null;
if($params['brand_id']){
$where['brand_id'] = $params['brand_id'];
} else {
$params['brand_id'] = '';
}
$count = $this->auto_series_model->count($where);
$rows = $this->auto_series_model->select($where, 'id desc', $page, $size);
$status_arr = $this->auto_series_model->get_status();
$list = [];
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
if($rows){
foreach($rows as $key=>$val){
$brand_name = $map_brand[$val['brand_id']] ? $map_brand[$val['brand_id']] : '';
$list[] = [
'id' => $val['id'],
'brand_name' => $brand_name,
'name' => $val['name'],
'status' => $val['status'],
'status_name' => $status_arr[$val['status']],
'c_time' => date('Y-m-d H:i:s',$val['c_time'])
];
}
}
$this->data['lists'] = $list;
$this->data['params'] = $params;
$this->data['brandAry'] = $map_brand;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['_title'] = '车系列表';
$this->show_view('auto/series/lists', true);
}
/**
* 获取数据列表
* @return bool
*/
public function json_lists(){
$brand_id = $this->input->get_post('brand_id');
$page = $this->input->get_post('page');
$size = $this->input->get_post('size');
$where = array('status > -1' => null);
$brand_id && $where['brand_id'] = $brand_id;
$orderby = 'id desc';
$total = $this->auto_series_model->count($where);
$lists = array();
if($total){
$select = 'id, name';
$rows = $this->auto_series_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'name' => $v['name'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function get(){
$id = $this->input->get('id');
$info = [];
if ($id) {
$info = $this->auto_series_model->get(array('id' => $id));
if (!$info || empty($info)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
}
$brands = $this->auto_brand_model->select([],'','','','id,name');
$this->data['brands'] = $brands;
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑车系' : '新增车系';
return $this->show_view('auto/series/edit');
}
public function add(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->post('id');
$name = $this->input->post('name');
$brand_id = $this->input->post('brand_id');
if (!$name || empty($name)) {
return $this->show_json(SYS_CODE_FAIL, '车系名称不能为空');
}
$old = $this->auto_series_model->get(['name'=>$name,'status>'=>-1]);
if ($old) {
return $this->show_json(SYS_CODE_FAIL, '车系已经存在');
}
$add_data = array(
'name' => $name,
'brand_id' => $brand_id,
'c_time' => time()
);
$brand_id = $this->auto_series_model->add($add_data);
if (!$brand_id) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function edit(){
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->post('id');
$name = $this->input->post('name');
$brand_id = $this->input->post('brand_id');
$row = $this->auto_series_model->get(['id' => $id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
if (!$name) {
return $this->show_json(SYS_CODE_FAIL, '车系名称不能为空');
}
//防止车系名称重复
$where = array('name' => $name, "status<>-1" => null);
$id && $where['id <>'] = $id;
$old = $this->auto_series_model->get($where);
if ($old) {
return $this->show_json(SYS_CODE_FAIL, '车系已经存在');
}
$up_data = array(
'brand_id' => $brand_id,
'name' => $name,
);
$this->auto_series_model->update($up_data, array('id' => $id));
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$stauts = $this->input->post('status');
$where = array('id' => $id);
$this->auto_series_model->update(array('status' => $stauts), $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function batch(){
}
public function export(){
}
}
+476
View File
@@ -0,0 +1,476 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once COMMPATH.'third_party/PHPExcel.php';
class Settle extends HD_Controller
{
private $biz_type = [
1 => ['liche' => 0.25 , 'partner' => 0.75],
2 => ['liche' => 0.35 , 'partner' => 0.65],
];
public function __construct()
{
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_business_model');
$this->load->model('items/items_model');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model('biz/biz_model');
$this->load->model('biz/biz_settle_model');
$this->load->model('biz/biz_settle_static_model');
$this->load->model('biz/biz_info_model');
$this->load->model('biz/biz_trucking_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$where = array();
$t1 = 'lc_biz_settle';
$t2 = 'lc_receiver_orders_v2';
if($params['biz_id']){
$where["$t1.biz_id"] = $params['biz_id'];
} else{
$params['biz_id'] = '';
}
if($params['brand_id']){
$where["$t2.brand_id"] = $params['brand_id'];
} else{
$params['brand_id'] = '';
}
if($params['s_id']){
$where["$t2.s_id"] = $params['s_id'];
} else{
$params['s_id'] = '';
}
if($params['v_id']){
$where["$t2.v_id"] = $params['v_id'];
} else{
$params['v_id'] = '';
}
if($params['year']){
$where['year'] = $params['year'];
}elseif(!isset($params['year'])){
$where['year'] = $params['year'] = date('Y');
}
if($params['month']){
$where['month'] = $params['month'];
}elseif(!isset($params['month'])){
$where['month'] = $params['month'] = intval(date('m'));
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
$total = $this->biz_settle_model->selectOrders($where, '', '', '',1);
$lists = array();
if($total){
$orderby = "$t1.id desc";
$select = "$t1.*,$t2.sid,$t2.name,$t2.mobile,$t2.s_id,$t2.v_id,$t2.brand_id,$t2.cor_id,$t2.item_id";
$rows = $this->biz_settle_model->selectOrders($where, $orderby, $page, $size,0, $select);
if($rows){
$s_ids = array_unique(array_filter(array_column($rows,'s_id')));
$cor_ids = array_unique(array_filter(array_column($rows,'cor_id')));
$v_ids = array_unique(array_filter(array_column($rows,'v_id')));
$attr_ids = array_merge($cor_ids,$v_ids);
$item_ids = array_unique(array_filter(array_column($rows,'item_id')));
//获取车系列表
$map_sery = array();
if($s_ids){
$str_ids = implode(',', $s_ids);
$where_sery = array("id in ({$str_ids})" => null);
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
}
$map_attr = array();
if($attr_ids){
$str_ids = implode(',', $attr_ids);
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
}
$biz_ids = array_unique(array_column($rows,'biz_id'));
$map_biz = [];
if($biz_ids){
$biz_ids = implode(',',array_filter($biz_ids));
$where_biz = ["id in ({$biz_ids})" => null];
$map_biz = $this->biz_model->map('id', 'biz_name', $where_biz, '', 0, 0, 'id,biz_name');
}
$map_item = [];
if($item_ids){
$str_item_ids = implode(',',$item_ids);
$where_item = ["id in ({$str_item_ids})" => null];
$map_item = $this->items_model->map('id', 'vin', $where_item, '', 0, 0, 'id,vin');
}
foreach($rows as $v){
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]} {$map_attr[$v['cor_id']]}";
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
$lists[] = array(
'id' => $v['id'],
'o_id' => $v['o_id'],
'title' => $title,
'biz_name' => $map_biz[$v['biz_id']],
'profix_car' => $v['profix_car'],
'profix_insure' => $v['profix_insure'],
'profix_carno' => $v['profix_carno'],
'profix_loan' => $v['profix_loan'],
'price_trucking' => $v['price_trucking'],
'name' => $v['name'],
'mobile' => $v['mobile'],
'sid' => $v['sid'],
'month' => $month,
'vin' => $map_item[$v['item_id']]
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['brandAry'] = $map_brand;
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
$this->data['_title'] = '商家结算管理';
$this->show_view('biz/settle/lists',true);
}
public function get(){
}
public function add(){
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
$biz_id = $this->input->get('id');
$month = $this->input->get('month');
$year = date('Y');
!$month && $month = intval(date('m'));
$where = [
'biz_id' => $biz_id,
'year' => $year,
'month' => $month
];
$type_arr = $this->biz_settle_static_model->other_price_type();
$biz = $this->biz_model->get(['id'=>$biz_id],'biz_name');
$row = $this->biz_settle_static_model->get($where);
$sheet_data = [];
if($row){
$sheet_data[] = [
'门店','单车总毛利','税后单车总毛利','水平业务总毛利',
'店面租金','水电费','店长工资','店员工资',
'抽成','拖车费','其它费用','总利润',
'狸车分润','合伙人分润','时间'];
$row['month_str'] = date('Y-m',strtotime("{$row['year']}-{$row['month']}"));
$row['total_need'] = $row['rent'] + $row['wat_ele'] + $row['manager_wage'] + $row['employee_wage'] + $row['commission'] + $row['price_trucking'];
$row['price_ml'] = $row['price_total'] - $row['total_need'];
$other_price = '';
$other_json = json_decode($row['price_other'],true);
if($other_json){
foreach($other_json as $key=>$val){
$type_cn = $type_arr[$val['type']];
$other_price .= $val['name'].$val['money']."({$type_cn})\n";
}
}
$sheet_data[] = [
$biz['biz_name'],
$row['profix_car'],
$row['profix_car_after'],
$row['price_all'],
$row['rent'],
$row['wat_ele'],
$row['manager_wage'],
$row['employee_wage'],
$row['commission'],
$row['price_trucking'],
$other_price,
$row['price_ml'],
$row['profix_liche'],
$row['profix_partner']+$row['profix_partner_oflow'],
$row['month_str']
];
}
$t1 = 'lc_biz_settle';
$t2 = 'lc_receiver_orders_v2';
$where = [
"{$t1}.biz_id" => $biz_id,
"{$t1}.year" => $year,
"{$t1}.month" => $month
];
$orderby = "$t1.id desc";
$select = "$t1.*,$t2.sid,$t2.name,$t2.mobile,$t2.s_id,$t2.v_id,$t2.brand_id,$t2.cor_id,$t2.item_id";
$all_rows = $this->biz_settle_model->selectOrders($where, $orderby, 0, 0,0, $select);
$sheet_data2 = [];
if($all_rows){
$sheet_data2[] = ['门店','订单信息','品牌车型','车架号','单车利润','保险利润','贷款利润','挂牌利润','拖车费','时间'];
$s_ids = array_unique(array_filter(array_column($all_rows,'s_id')));
$cor_ids = array_unique(array_filter(array_column($all_rows,'cor_id')));
$v_ids = array_unique(array_filter(array_column($all_rows,'v_id')));
$attr_ids = array_merge($cor_ids,$v_ids);
$item_ids = array_unique(array_filter(array_column($all_rows,'item_id')));
//获取车系列表
$map_sery = array();
if($s_ids){
$str_ids = implode(',', $s_ids);
$where_sery = array("id in ({$str_ids})" => null);
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
}
$map_attr = array();
if($attr_ids){
$str_ids = implode(',', $attr_ids);
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
}
$map_item = [];
if($item_ids){
$str_item_ids = implode(',',$item_ids);
$where_item = ["id in ({$str_item_ids})" => null];
$map_item = $this->items_model->map('id', 'vin', $where_item, '', 0, 0, 'id,vin');
}
foreach($all_rows as $v){
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]} {$map_attr[$v['cor_id']]}";
$vin = $map_item[$v['item_id']];
$month_str = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
$sheet_data2[] = array(
$biz['biz_name'],
"{$v['name']} {$v['mobile']}",
$title,
$vin,
$v['profix_car'],
$v['profix_insure'],
$v['profix_loan'],
$v['profix_carno'],
$v['price_trucking'],
$month_str,
);
}
}
$cells = array('A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
$obpe = new PHPExcel();
if($sheet_data){
$obpe->setactivesheetindex(0);
foreach($sheet_data as $key=>$val){
foreach($val as $k2=>$v2){
$cell = $cells[$k2];
$k = $key+1;
$obpe->getactivesheet()->setcellvalue("{$cell}{$k}", $v2);
}
}
}
if($sheet_data2){
//创建一个新的工作空间(sheet)
$obpe->createSheet();
$obpe->setactivesheetindex(1);
foreach($sheet_data2 as $key=>$val){
foreach($val as $k2=>$v2){
$cell = $cells[$k2];
$k = $key+1;
$obpe->getactivesheet()->setcellvalue("{$cell}{$k}", $v2);
}
}
}
$filename = $biz['biz_name']."_{$year}{$month}月_结算表";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control:must-revalidate, post-check=0, pre-check=0");
header("Content-Type:application/force-download");
header("Content-Type:application/vnd.ms-execl");
header("Content-Type:application/octet-stream");
header("Content-Type:application/download");;
header('Content-Disposition:attachment;filename='. $filename .'.xlsx');
header("Content-Transfer-Encoding:binary");
$writer = PHPExcel_IOFactory::createWriter($obpe, 'Excel2007');
$writer->save('php://output');
}
//统计合计
public function lists_static(){
$params = $this->input->get();
$where = [];
if($params['year']){
$where['year'] = $params['year'];
}elseif(!isset($params['year'])){
$where['year'] = $params['year'] = date('Y');
}
if($params['month']){
$where['month'] = $params['month'];
}elseif(!isset($params['month'])){
$where['month'] = $params['month'] = intval(date('m',strtotime("-1 month")));
}
if($params['id']){
$where['biz_id'] = $params['id'];
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$total = $this->biz_settle_static_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = '*';
$rows = $this->biz_settle_static_model->select($where, $orderby, $page, $size, $select);
if($rows){
$biz_ids = array_unique(array_column($rows,'biz_id'));
$map_biz = [];
if($biz_ids){
$biz_ids = implode(',',$biz_ids);
$where_biz = ["id in ({$biz_ids})" => null];
$map_biz = $this->biz_model->map('id', 'biz_name', $where_biz, '', 0, 0, 'id,biz_name');
}
//属性按'车型-车身颜色-内饰颜色'排序
foreach($rows as $v){
$temp = $v;
$temp['biz_name'] = $map_biz[$v['biz_id']];
$temp['month_str'] = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
$temp['price_other'] = $v['price_other'] ? json_decode($v['price_other']) : [];
$temp['total_need'] = $v['rent'] + $v['wat_ele'] + $v['manager_wage'] + $v['employee_wage'] + $v['commission'] + $v['price_trucking'];
$temp['price_ml'] = $v['price_total'] - $temp['total_need'];
$temp['profix_partner'] = $v['profix_partner'] + $v['profix_partner_oflow'];
$lists[] = $temp;
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['type_arr'] = $this->biz_settle_static_model->other_price_type();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
$this->data['_title'] = '商家结算管理';
$this->show_view('biz/settle/lists_static',true);
}
//重新统计
public function edit_static(){
$id = $this->input->post('id');
$row = $this->biz_settle_static_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$all_other = 0; //共同承担其它费用
$liche_other = 0; //狸车承担其它费用
$partner_other = 0; //合伙人承担其它费用
$price_other = json_decode($row['price_other'],true);
if($price_other){
foreach($price_other as $item){
if($item['type']==2){
$partner_other += $item['money'];
}elseif($item['type']==1){
$liche_other += $item['money'];
}else{
$all_other += $item['money'];
}
}
}
$car_total = $this->biz_settle_model->count(['stic_id'=>$row['id']]);
$biz_info = $this->biz_info_model->get(['biz_id'=>$row['biz_id']]);
$type_config = $this->biz_type[$biz_info['type']];
$update = [
'rent' => $biz_info['rent'],
'wat_ele' => $biz_info['wat_ele'],
'manager_wage' => $biz_info['manager_wage'],
'commission' => $biz_info['commission']*$car_total,
];
$employee_wage = $biz_info['num'] ? ceil($car_total/$biz_info['num']) : 0;
$update['employee_wage'] = $employee_wage;
$settle_rows = $this->biz_settle_model->select(['stic_id'=>$row['id']],'id asc',0,0,'id,o_id');
if(is_array($settle_rows)){
$o_id_str = implode(',',array_column($settle_rows,'o_id'));
$order_rows = [];
if($o_id_str){
$where = [
"id in ($o_id_str)" => null
];
$order_rows = $this->receiver_orders_v2_model->map('id','brand_id',$where,0,0,'id,brand_id');
}
foreach($settle_rows as $val){
$auto_b_id = $order_rows[$val['o_id']] ? $order_rows[$val['o_id']] : 0;
$truck_row = $this->biz_trucking_model->get(['biz_id'=>$row['biz_id'],'auto_b_id'=>$auto_b_id,'status'=>1]);
$price = $truck_row ? $truck_row['money'] : 0;
$this->biz_settle_model->update(['price_trucking'=>$price],['id'=>$val['id']]);
}
}
$truck_sum = $this->biz_settle_model->sum('price_trucking',['stic_id' => $row['id']]);
$update['price_trucking'] = $truck_sum['price_trucking'];
$price_need = $update['rent'] + $update['wat_ele'] + $update['employee_wage'] + $update['manager_wage'] + $update['commission'] + $update['price_trucking'];
$price_ml = $row['price_total'] - $price_need - $all_other;
$update['profix_liche'] = $price_ml*$type_config['liche']-$liche_other;
$update['profix_partner'] = $price_ml*$type_config['partner']-$partner_other;
$this->biz_settle_static_model->update($update,['id'=>$row['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function add_price(){
$id = $this->input->get_post('id');
$row = $this->biz_settle_static_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if($this->input->method()=='post'){
$lists = $this->input->post('lists');
if(!is_array($lists)){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$price_other = [];
foreach($lists as $key=>$val){
if($val['money']){
$price_other[] = [
'name' => $val['name'],
'money' => $val['money'],
'type' => $val['type'] ? $val['type'] : 0
];
}
}
$up_data['price_other'] = json_encode($price_other,JSON_UNESCAPED_UNICODE);
$this->biz_settle_static_model->update($up_data,['id'=>$id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
$lists = $row['price_other'] ? json_decode($row['price_other']) : [];
$this->data['id'] = $id;
$this->data['lists'] = $lists;
$this->data['type_arr'] = $this->biz_settle_static_model->other_price_type();
$this->show_view('biz/settle/add');
}
}
+197
View File
@@ -0,0 +1,197 @@
<?php
/**
* Notes:店铺概况
* Created on: 2022/1/7 14:52
* Created by: dengbw
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Situation extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model("biz/biz_brand_model", 'mdBizBrand');
$this->load->model("biz/biz_base_model", 'mdBizBase');
$this->load->model("biz/biz_sell_model", 'mdBizSell');
$this->load->model('area_model', 'mdArea');
$this->load->model('sys/sys_street_model', 'mdStreet');
$this->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');
}
/**
* Notes:
* Created on: 2022/1/7 14:52
* Created by: dengbw
*
*/
public function index()
{
$this->lists();
}
public function lists()
{
}
public function get()
{
$biz_id = $this->input->get('id');
$re_biz = $this->mdBiz->get(['id' => $biz_id, 'status' => 1]);
if (!$re_biz || empty($re_biz)) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
$base_info = [];
//店铺概况
$re_base = $this->mdBizBase->get(['biz_id' => $biz_id]);
$fields = $this->mdBizBase->get_fields();
foreach ($fields as $key => $value) {
$list = '';
if ($key == 'county_id' && $re_biz['county_id']) {//县区
$result = $this->mdArea->get(['county_id' => $re_biz['county_id']]);
$fields[$key]['value'] = $result['county_name'];
} else if ($key == 'street_id' && $re_biz['street_id']) {//乡镇
$result = $this->mdStreet->get(['street_id' => $re_biz['street_id']]);
$fields[$key]['value'] = $result['street_name'];
} else if ($key == 'company' && $re_biz['brand_id']) {//公司名称
$result = $this->mdBizBrand->get(['id' => $re_biz['brand_id']]);
$result['brand_name'] && $fields[$key]['value'] = $result['brand_name'];
} else if ($key == 'level') {//级别
$fields[$key]['value'] = $this->level($biz_id);
} else if ($key == 'type' && $re_biz['type']) {//类型
$fields[$key]['value'] = $this->mdBiz->type_ary($re_biz['type']);
} else if ($key == 'address' && $re_biz['address']) {//位置
$fields[$key]['value'] = $re_biz['address'];
} else if ($key == 'lead' && $re_base[$key]) {//负责人
$result = $this->mdUsers->get(['id' => $re_base[$key]]);
$fields[$key]['value'] = $result['uname'];
} else if ($key == 'imgs') {//图片
$imgs = $re_base[$key] ? json_decode($re_base[$key], true) : [];
foreach ($fields[$key]['list'] as $key2 => $value2) {
$setValue = $value2;
if ($imgs[$value2['id']]) {
$setValue['src'] = build_qiniu_image_url($imgs[$value2['id']]);
} else {
$setValue['src'] = '/static/images/webuploader/bg.png';
}
$list[] = $setValue;
}
$fields[$key]['list'] = $list;
} else if ($re_base && $re_base[$key]) {//有字段赋值
$fields[$key]['value'] = $re_base[$key];
}
$setValue = $fields[$key];
$setValue['field'] = $key;
$base_info[] = $setValue;
}
//售卖概况
$this->data['base_info'] = $base_info;
$showInfo['biz_id'] = $biz_id;
$showInfo['sell_info'] = '';
$showInfo['y_month'] = date('Y-m', strtotime("-1 month"));//上个月
$y_month_ary = [];
for ($i = 1; $i <= 12; $i++) {
$y_month_ary[] = date('Y-m', strtotime("-{$i} month"));
}
$showInfo['y_month_ary'] = $y_month_ary;
$this->data['showInfo'] = $showInfo;
$this->data['_title'] = $re_biz['biz_name'];
return $this->show_view('biz/situation/get', true);
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
public function get_sell_info()
{
$biz_id = intval($this->input->post('biz_id'));
$y_month = $this->input->post('y_month');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$sell_info = [];
if (!$y_month) {
$y_month = date('Y-m', strtotime("-1 month"));//上个月
}
$re_sell = $this->mdBizSell->get(['biz_id' => $biz_id, 'y_month' => $y_month]);
$fields = $this->mdBizSell->get_fields();
foreach ($fields as $key => $value) {
if ($key == 'boss_sell') {
$fields[$key]['value'] = $re_sell['boss_sell'] ? '是' : '否';
} else {
$re_sell[$key] && $fields[$key]['value'] = $re_sell[$key];
}
$setValue = $fields[$key];
$setValue['field'] = $key;
$sell_info[] = $setValue;
}
$this->data = array('sell_info' => $sell_info);
return $this->show_json(SYS_CODE_SUCCESS);
}
private function level($biz_id = 0)
{
$str = '';
if ($biz_id) {
$where = ['biz_id' => $biz_id, 'status<>' => -1, 'brand_id<>' => 3, 'biz_id<>' => 1];
$last_month_s = date("Y-m-01", strtotime("-1 month"));//上1个月1日
$last_month_e = date("Y-m-d", strtotime("$last_month_s +1 month -1 day")); //上1个月最后一天
$orders = $this->mdOrders->count(array_merge($where, ['c_time >=' => strtotime($last_month_s . ' 00:00:00')
, 'c_time <=' => strtotime($last_month_e . ' 23:59:59')]));
if ($orders >= 12) {
$str = 'A1';
} else if ($orders >= 9) {
$str = 'A2';
} else if ($orders >= 6) {
$str = 'A3';
} else if ($orders >= 5) {
$str = 'B1';
} else if ($orders >= 4) {
$str = 'B2';
} else if ($orders >= 3) {
$str = 'B3';
} else {
$month_s = date("Y-m-01", strtotime("-3 month")); //上3个月1日
$month_e = date("Y-m-d", strtotime("$month_s +1 month -1 day")); //上3个月最后一天
$orders = $this->mdOrders->count(array_merge($where, ['c_time >=' => strtotime($month_s . ' 00:00:00')
, 'c_time <=' => strtotime($month_e . ' 23:59:59')]));
if ($orders && $orders <= 8) {
$str = 'C1';
} else {
$month_s = date("Y-m-d", strtotime("$last_month_s -15 day"));//45天前
$month_e = $last_month_e; //上个月最后一天
$orders = $this->mdOrders->count(array_merge($where, ['c_time >=' => strtotime($month_s . ' 00:00:00')
, 'c_time <=' => strtotime($month_e . ' 23:59:59')]));
if ($orders == 1) {
$str = 'C2';
} else if ($orders == 0) {
$this->load->model('items/items_model', 'mdItems');
$count_items = $this->mdItems->count(['status<>' => 0, 'biz_id' => $biz_id, 'brand_id<>' => 3, 'biz_id<>' => 1]);
!$count_items && $str = 'C3';//门店有样车未开单
}
}
}
}
return $str;
}
}
+21 -10
View File
@@ -42,14 +42,21 @@ class Brand extends HD_Controller
public function get()
{
$id = $this->input->get('id');
if ($id) {
$info = $this->bizBrand->get(array('id' => $id));
if (!$info || empty($info)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$this->data['id'] = $id;
$this->data['info'] = $info;
$action = '/biz/brand/brand/edit';
} else {
$info = array();
$action = '/biz/brand/brand/add';
}
$this->data['info'] = $info;
$this->data['action'] = $action;
$this->data['_title'] = $id ? '编辑品牌' : '新增品牌';
return $this->show_view('biz/brand/edit');
}
@@ -75,8 +82,10 @@ class Brand extends HD_Controller
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$brand_name = $this->input->post('brand_name');
$img = $this->input->post('img');
$info = $this->input->post('info');
$brand_name = $info['brand_name'];
$img = $info['brand_logo'];
$type = $info['type'];
if (!$brand_name || empty($brand_name)) {
return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
}
@@ -103,17 +112,19 @@ class Brand extends HD_Controller
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = $this->input->get('id');
$info = $this->bizBrand->get(array('id' => $id));
if (!$info || empty($info)) {
$info = $this->input->post('info');
$id = $info['id'];
$brand_name = $info['brand_name'];
$img = $info['brand_logo'];
$type = $info['type'];
$row = $this->bizBrand->get(array('id' => $id));
if (!$row || empty($row)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$brand_name = $this->input->post('brand_name');
$img = $this->input->post('img');
if (!$brand_name || empty($brand_name)) {
return $this->show_json(SYS_CODE_FAIL, '品牌名称不能为空');
}
//防止品牌名称重复添加
//防止品牌名称重复
$where1 = array('brand_name' => $brand_name, "status<>-1" => null);
$id && $where1['id <>'] = $id;//修改时也不允许重复
$old = $this->bizBrand->get($where1);
+321 -12
View File
@@ -18,6 +18,10 @@ class Store extends HD_Controller
$this->load->helper('image_helper');
$this->load->model("biz/biz_model");
$this->load->model("biz/biz_tagdata_model");
$this->load->model("biz/biz_info_model");
$this->load->model("biz/biz_trucking_model");
$this->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->load->model('auto/auto_brand_model');
$this->load->model("biz/biz_brand_model", 'bizBrand');
$this->load->model('area_model');
@@ -31,20 +35,35 @@ class Store extends HD_Controller
public function lists()
{
$params = $this->input->get();
$page = $this->input->get('page');
$status = $this->input->get('status');
$this->data['province_id'] = $province_id = $this->input->get('province_id', true);
$this->data['city_id'] = $city_id = intval($this->input->get('city_id', true));
$this->data['province_id'] = $province_id = 350;//默认福建城市
$this->data['city_id'] = $city_id = intval($this->input->get('_city_id', true));
$this->data['county_id'] = $county_id = intval($this->input->get('county_id', true));
$this->data['bizname'] = $bizname = $this->input->get('bizname');
$this->data['brand_id'] = $brand_id = intval($this->input->get('brand_id'));
$this->data['content'] = $content = $this->input->get('content');
$this->data['article'] = $article = $this->input->get('article');
$this->data['company_id'] = $company_id = intval($this->input->get('company_id'));
$status_arr = array('del' => -1, 'off' => 0, 'on' => 1);
$this->data['provinces'] = $this->area_model->select(array(), '', 0, 0, 'distinct(province_id), province_name');
if ($province_id) {
$this->data['citys'] = $this->area_model->select(array('province_id' => $province_id), '', 0, 0, 'distinct(city_id), city_name');
//获取系统配置的城市
$map_city = $this->city_ary();
$rows_city = array();
foreach ($map_city as $k => $v) {
$rows_city[] = array(
'city_id' => $k,
'city_name' => $v
);
}
$this->data['citys'] = $rows_city;
}
if ($city_id) {
$this->data['countys'] = $this->area_model->select(array('city_id' => $city_id));
}
if (isset($status_arr[$status])) {
$this->data['status'] = $status;
@@ -53,33 +72,79 @@ class Store extends HD_Controller
$where['status > -1'] = null;
}
$company_id && $where['company_id'] = $company_id;
!$page && $page = 1;
$pagesize = 20;
$bizname && $where['biz_name like "%' . $bizname . '%"'] = null;
$brand_id && $where['brand_id'] = $brand_id;
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['type'] && $params['type'] = '';
if ($params['type']) {
$where['type'] = $params['type'];
}
if ($params['qdjl_id']) {//渠道经理
$re_bu = $this->mdLichebUsers->get(array('id' => $params['qdjl_id']));
if ($re_bu['biz_id']) {
$where["id in({$re_bu['biz_id']})"] = null;
} else {
$where['id'] = -1;
}
}
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
$count = $this->biz_model->count();
$count = $this->biz_model->count($where);
$bizlists = [];
$typeAry = $this->biz_model->type_ary();
foreach ($biz_lists as $v) {
$brand = $this->bizBrand->get(array('id' => $v['brand_id']),'brand_name');
$brand = $this->bizBrand->get(array('id' => $v['brand_id']), 'brand_name');
$v['brand_name'] = $brand['brand_name'];
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
$v['type_name'] = $typeAry[$v['type']];
$v['type'] = $v['type'];
$bizlists[] = $v;
}
//获取公司ID列表
$this->load->model("sys/sys_company_model", 'company_model');
$where = array('status' => 1);
$orderby = 'id desc';
$select = 'id, short';
$map_company = $this->company_model->map('id', 'short', $where, $orderby, 0, 0, $select);
//获取品牌
$lists = $this->bizBrand->select(array('status' => 1),'','','','brand_name,id');
$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
$data = array();
if ($lists) {
foreach ($lists as $value) {
$data[] = array('name' => $value['brand_name'], 'id' => $value['id']);
}
}
$qdjl_lists = [];
$res_u = $this->mdLichebUsers->select(array('group_id' => 4, 'status' => 1), 'id desc', 0, 0, 'id,uname as name,city_id');
if ($res_u) {
$this->load->model("sys/sys_city_model", 'mdSysCity');
foreach ($res_u as $value) {
$city_name = $name = $value['name'];
if ($value['city_id']) {
$re_c = $this->mdSysCity->get(['city_id' => $value['city_id']]);
$re_c && $city_name .= "({$re_c['name']})";
}
$qdjl_lists[] = array('id' => $value['id'], 'name' => $name, 'city_name' => $city_name);
}
}
$this->data['qdjl_lists'] = $qdjl_lists;
$this->data['params'] = $params;
$this->data['brand_list'] = $data;
$this->data['companyAry'] = $map_company;
$this->data['typeAry'] = $typeAry;
$this->data['lists'] = $bizlists;
$this->data['_title'] = '门店列表';
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
@@ -91,7 +156,7 @@ class Store extends HD_Controller
$id = intval($this->input->get('id'));
$this->data['provinces'] = $this->area_model->select(array(), '', 0, 0, 'distinct(province_id), province_name');
//获取品牌
$lists = $this->bizBrand->select(array('status' => 1),'','','','brand_name,id');
$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
$data = array();
if ($lists) {
foreach ($lists as $value) {
@@ -102,6 +167,7 @@ class Store extends HD_Controller
if ($id) {
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
if (!$biz || empty($biz)) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
@@ -133,9 +199,43 @@ class Store extends HD_Controller
}
}
if ($biz['jsondata']) {
$jsondata = json_decode($biz['jsondata'], true);
$biz['auto_brands'] = $jsondata ? $jsondata['auto_brands'] : array();
} else {
$biz['auto_brands'] = array();
}
$this->data['biz'] = $biz;
} else {
$map_city = $this->city_ary();
$rows_city = array();
foreach ($map_city as $k => $v) {
$rows_city[] = array(
'city_id' => $k,
'city_name' => $v
);
}
$this->data['citys'] = $rows_city;
$biz = array(
'province_id' => '350',
'type' => 0,
'company_id' => 0,
'auto_brands' => array(),
'car_brand_id' => 0
);//默认福建城市
$this->data['biz'] = $biz;
}
//获取公司ID列表
$this->load->model("sys/sys_company_model", 'company_model');
$where = array('status' => 1);
$orderby = 'id desc';
$select = 'id, short';
$map_company = $this->company_model->map('id', 'short', $where, $orderby, 0, 0, $select);
$this->data['typeAry'] = $this->biz_model->type_ary();
$this->data['companyAry'] = $map_company;
$this->data['_title'] = $id ? '编辑门店' : '新增门店';
$this->show_view('biz/store/edit', true);
}
@@ -143,6 +243,7 @@ class Store extends HD_Controller
public function add()
{
$biz['status'] = 1;
$biz['biz_name'] = $this->input->post('biz_name', true);
if (!$biz['biz_name']) {
return $this->show_json(SYS_CODE_FAIL, '商家名称不能为空');
@@ -164,6 +265,20 @@ class Store extends HD_Controller
$biz['address'] = $this->input->post('address', true);
$biz['lat'] = $this->input->post('lat', true);
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$biz['company_id'] = intval($this->input->post('company_id', true));
$biz['srv_company_id'] = intval($this->input->post('srv_company_id', true));
$biz['car_brand_id'] = intval($this->input->post('car_brand_id', true));
if ($biz['type'] == 1 && !$biz['car_brand_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型品牌');
}
$auto_brands = $this->input->post('auto_brands');
if ($auto_brands) {
$jsondata = array('auto_brands' => $auto_brands);
$biz['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
}
//上传头像
$biz['headimg'] = $this->input->post('headimg');
@@ -200,6 +315,8 @@ class Store extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$id = intval($this->input->post('id'));
$company_id = intval($this->input->post('company_id', true));
$srv_company_id = intval($this->input->post('srv_company_id', true));
$biz['biz_name'] = $this->input->post('biz_name', true);
if (!$biz['biz_name']) {
@@ -222,10 +339,28 @@ class Store extends HD_Controller
$biz['address'] = $this->input->post('address', true);
$biz['lat'] = $this->input->post('lat', true);
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$company_id && $biz['company_id'] = $company_id;
$srv_company_id && $biz['srv_company_id'] = $srv_company_id;
$biz['car_brand_id'] = intval($this->input->post('car_brand_id', true));
if ($biz['type'] == 1 && !$biz['car_brand_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择车型品牌');
}
//上传头像
$biz['headimg'] = $this->input->post('headimg');
//授权品牌
$auto_brands = $this->input->post('auto_brands');
$old = $this->biz_model->get(array('id' => $id));
$jsondata = json_decode($old['jsondata'], true);
if ($auto_brands) {
$jsondata['auto_brands'] = $auto_brands;
} else {
unset($jsondata['auto_brands']);
}
$biz['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
//商家标签
$tag_more = $this->input->post('tag_more');
if (!$tag_more || !is_array($tag_more)) {
@@ -522,7 +657,7 @@ class Store extends HD_Controller
$upd = array('r_ubid' => 0);
$where = array('r_ubid' => $id);
$ret = $this->receiver_orders_model->update($upd, $where);
if(!$ret){
if (!$ret) {
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
@@ -753,6 +888,79 @@ class Store extends HD_Controller
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
/**
* 获取店铺可选列表
* @return bool
*/
function json_lists()
{
$province_id = $this->input->post('province_id');
$city_id = $this->input->post('city_id');
$county_id = $this->input->post('county_id');
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$title = $this->input->post('title');
$type = $this->input->post('type');
$where = array();
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$where['status > -1'] = null;
}
if ($type) {
$where["type in({$type})"] = null;
} else {
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["id in ($biz_ids)"] = null;
}
}
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$title && $where["biz_name like '%{$title}%'"] = null;
$total = $this->biz_model->count($where);
$lists = array();
if ($total) {
$orderby = 'id desc';
$select = 'id, biz_name';
$rows = $this->biz_model->select($where, $orderby, $page, $size, $select);
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['id'],
'title' => $v['biz_name'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* 获取店铺信息
* @return bool
*/
function json_get()
{
$id = $this->input->post('id');
$row = $this->biz_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['biz_name'],
'city_id' => $row['city_id'],
'county_id' => $row['county_id'],
);
$this->data = $info;
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* 获取用户信息(不存在新增,可以修改名称)
* @param $mobile
@@ -807,4 +1015,105 @@ class Store extends HD_Controller
return array($status, $data, $msg);
}
public function get_info()
{
$biz_id = $this->input->get('id');
if (!$this->biz_model->get(['id' => $biz_id])) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
$base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
if (!$base_info) {
$this->biz_info_model->add(['biz_id' => $biz_id, 'c_time' => time()]);
$base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
}
$info = [
'id' => $base_info['id'],
'biz_id' => $base_info['biz_id'],
'name' => $base_info['name'],
'mobile' => $base_info['mobile'],
'margin' => $base_info['margin'],
'area' => $base_info['area'],
'rent' => $base_info['rent'],
'wat_ele' => $base_info['wat_ele'],
'employee_wage' => $base_info['employee_wage'],
'manager_wage' => $base_info['manager_wage'],
'commission' => $base_info['commission'],
'num' => $base_info['num'],
's_time' => $base_info['s_time'] ? date('Y-m-d', $base_info['s_time']) : '',
'e_time' => $base_info['e_time'] ? date('Y-m-d', $base_info['e_time']) : '',
'type' => $base_info['type'],
'rate' => strlen($base_info['rate']) ? $base_info['rate'] : 0,
];
$brands = [];
$b_rows = $this->biz_trucking_model->select(['biz_id' => $base_info['biz_id'], 'status' => 1], '', '', '', 'auto_b_id,money');
if ($b_rows) {
$auto_b_ids = array_column($b_rows, 'auto_b_id');
$auto_b_ids = $auto_b_ids ? implode(',', $auto_b_ids) : 0;
$where["id in ($auto_b_ids)"] = null;
$auto_rows = $this->auto_brand_model->map('id', 'name', $where, '', '', '', 'id,name');
foreach ($b_rows as $key => $val) {
$brands[] = [
'id' => $val['auto_b_id'],
'name' => $auto_rows[$val['auto_b_id']],
'money' => $val['money']
];
}
}
$this->data['type_arr'] = [1 => '扩展', 2 => '新建'];
$this->data['brands'] = $brands;
$this->data['info'] = $info;
$this->data['_title'] = '编辑门店基本信息';
$this->show_view('biz/store/get_info', true);
}
public function edit_info()
{
$info = $this->input->post('info');
$brands = $this->input->post('brands');
if (!$this->biz_info_model->get(['id' => $info['id']])) {
return $this->show_json(SYS_CODE_FAIL, '错数错误!');
}
if ($info['rate'] < 0 || $info['rate'] > 100) {
return $this->show_json(SYS_CODE_FAIL, '分佣比例请填写0~100');
}
$up_data = [
'name' => $info['name'],
'mobile' => $info['mobile'],
'margin' => $info['margin'],
'area' => $info['area'],
'rent' => $info['rent'],
'wat_ele' => $info['wat_ele'],
'employee_wage' => $info['employee_wage'],
'manager_wage' => $info['manager_wage'],
'commission' => $info['commission'],
's_time' => $info['s_time'] ? strtotime($info['s_time']) : 0,
'e_time' => $info['e_time'] ? strtotime($info['e_time']) : 0,
'type' => $info['type'],
'rate' => $info['rate'],
'num' => $info['num']
];
$this->biz_info_model->update($up_data, ['id' => $info['id']]);
$b_ids = array_column($brands, 'id');
if ($b_ids) {
$b_ids = implode(',', $b_ids);
$this->biz_trucking_model->update(['status' => -1], ["auto_b_id not in ({$b_ids})" => null, 'biz_id' => $info['biz_id']]);
foreach ($brands as $key => $val) {
$s_row = $this->biz_trucking_model->get(['biz_id' => $info['biz_id'], 'auto_b_id' => $val['id']]);
$data = [
'money' => $val['money'],
'status' => 1
];
if ($s_row) {
$this->biz_trucking_model->update($data, ['id' => $s_row['id']]);
} else {
$data['biz_id'] = $info['biz_id'];
$data['auto_b_id'] = $val['id'];
$data['c_time'] = time();
$this->biz_trucking_model->add($data);
}
}
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
}
+284
View File
@@ -0,0 +1,284 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:车辆盘点
* Created on: 2022/2/18 16:43
* Created by: dengbw
*/
class Inventory extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('items/Items_inventory_model', 'mdInventory');
$this->load->model('items/Items_inventory_log_model', 'mdInventoryLog');
$this->load->model('items/items_oplogs_model', 'mdItemsOplogs');
$this->load->model('items/items_model', 'mdItems');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model("sys/sys_addr_model", 'addr_model');
$this->load->model('area_model', 'mdArea');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $where = [];
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time>="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time<="] = strtotime($time[1] . ' 23:59:59');
}
$total = $this->mdInventory->count($where);
if ($total) {
$res = $this->mdInventory->select($where, "c_time desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = [];
$setValue['id'] = $value['id'];
$setValue['title'] = '盘点时间_' . date('Y-m-d', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = "车辆盘点";
$this->show_view('items/inventory/lists', true);
}
public function lists_log()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
if (!$params['inve_id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re = $this->mdInventory->get(array('id' => $params['inve_id']));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '车辆盘点不存在!');
}
$lists = $where = [];
if (strlen($params['status'])) {
$where['lc_items_inventory_log.status'] = $params['status'];
} else {
$params['lc_items_inventory_log.status in(0,1)'] = null;
$params['status'] = '-99';
}
if ($params['biz_id']) {
$where['lc_items_inventory_log.biz_id'] = $params['biz_id'];
}
if ($params['biz_id'] == -1 && $params['addr_id']) {
$where['lc_items_inventory_log.addr_id'] = $params['addr_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
$res_addr = $this->addr_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($res_biz && $res_addr) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$str_addr_ids = implode(',', array_column($res_addr, 'id'));
$where["(lc_items_inventory_log.biz_id in ({$str_ids}) or lc_items_inventory_log.addr_id in ({$str_addr_ids}))"] = null;
} else if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["lc_items_inventory_log.biz_id in ({$str_ids})"] = null;
} else if ($res_addr) {
$str_addr_ids = implode(',', array_column($res_addr, 'id'));
$where["lc_items_inventory_log.addr_id in ({$str_addr_ids})"] = null;
} else {
$where['lc_items_inventory_log.biz_id'] = -2;
}
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['addr_id'] = '';
$params['biz_id'] = '';
}
if ($params['item_status']) {
if ($params['item_status'] == 3) {
$where["lc_items.bill_time<>"] = '0000-00-00 00:00:00';
} else {
$where["lc_items.status"] = $params['item_status'];
}
}
if ($params['vin']) {
$where["lc_items.vin like '%{$params['vin']}%'"] = null;
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
if ($params['brand_id']) {
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$statusAry = $this->mdInventoryLog->statusAry();
$carImgAry = $this->mdInventoryLog->carImgAry();
$total = $this->db->select('lc_items_inventory_log.id')
->join('lc_items', 'lc_items.id = lc_items_inventory_log.item_id', 'left')
->where($where)
->count_all_results('lc_items_inventory_log');
if ($total) {
$offset = ($params['page'] - 1) * $params['size'];
$limit = $params['size'];
$this->db->from('lc_items_inventory_log');
$this->db->join('lc_items', 'lc_items.id = lc_items_inventory_log.item_id', 'left');
$this->db->select('lc_items_inventory_log.item_id,lc_items_inventory_log.biz_id,lc_items_inventory_log.addr_id
,lc_items_inventory_log.status,lc_items_inventory_log.jsondata
,lc_items.status as itemStatus,lc_items.bill_time,lc_items.brand_id,lc_items.s_id,lc_items.v_id,lc_items.cor_id,lc_items.vin,lc_items.in_time,lc_items.in_time');
$this->db->where($where);
$this->db->order_by('lc_items_inventory_log.id Desc');
$this->db->limit($limit, $offset);
$res = $this->db->get()->result_array();
$brand_ids = $s_ids = $attr_vids = $attr_corids = $biz_ids = $addr_ids = array();
foreach ($res as $v) {
$v['brand_id'] && !in_array($v['brand_id'], $brand_ids) && $brand_ids[] = $v['brand_id'];
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
$v['addr_id'] && !in_array($v['addr_id'], $addr_ids) && $addr_ids[] = $v['addr_id'];
$v['s_id'] && !in_array($v['s_id'], $s_ids) && $s_ids[] = $v['s_id'];
$v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id'];
$v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id'];
}
$map_brand = $map_sery = $map_vid = $map_corid = $map_biz = $map_addr = array();
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$where = array("id in ({$str_ids})" => null);
$map_brand = $this->mdAutoBrand->map('id', 'name', $where);
}
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$where = array("id in ({$str_ids})" => null);
$map_sery = $this->mdAutoSeries->map('id', 'name', $where);
}
if ($attr_vids) {
$str_ids = implode(',', $attr_vids);
$where = array("id in ({$str_ids})" => null);
$map_vid = $this->mdAutoAttr->map('id', 'title', $where);
}
if ($attr_corids) {
$str_ids = implode(',', $attr_corids);
$where = array("id in ({$str_ids})" => null);
$map_corid = $this->mdAutoAttr->map('id', 'title', $where);
}
if ($biz_ids) {
$str_ids = implode(',', $biz_ids);
$where = array("id in ({$str_ids})" => null);
$map_biz = $this->mdBiz->map('id', 'biz_name', $where);
}
if ($addr_ids) {
$str_ids = implode(',', $addr_ids);
$where = array("id in ({$str_ids})" => null);
$orderby = 'id desc';
$select = 'id, title, city_name, county_name';
$rows_addr = $this->addr_model->select($where, $orderby, 0, 0, $select);
foreach ($rows_addr as $v) {
$map_addr[$v['id']] = "{$v['city_name']} {$v['county_name']} 其它 {$v['title']}";
}
}
foreach ($res as $key => $v) {
$address = $mileage = $itemStatus_name = $car_img = $where_logs = '';
if ($v['biz_id'] > 0) {
$address = $map_biz[$v['biz_id']];
$re_biz = $this->mdBiz->get(array('id' => $v['biz_id']));
if ($re_biz['county_id']) {
$re_area = $this->mdArea->get(array('county_id' => $re_biz['county_id']));
$re_area && $address = "{$re_area['city_name']} {$re_area['county_name']} {$address}";
} else if ($re_biz['city_id']) {
$re_area = $this->mdArea->get(array('city_id' => $re_biz['city_id']));
$re_area && $address = "{$re_area['city_name']} {$address}";
}
$where_logs = ["item_id" => $v['item_id'], 'type' => 2, 'biz_id_to' => $v['biz_id']];
} else if ($v['biz_id'] == -1 && $v['addr_id']) {
$address = $map_addr[$v['addr_id']];
$where_logs = ["item_id" => $v['item_id'], 'type' => 2, 'addr_id_to' => $v['addr_id']];
}
$title = "{$map_brand[$v['brand_id']]}-{$map_sery[$v['s_id']]}-{$map_vid[$v['v_id']]}-{$map_corid[$v['cor_id']]}";
if ($v['bill_time'] != '0000-00-00 00:00:00') {
$itemStatus_name = '已销售';
} else if ($v['itemStatus'] == 1) {
$itemStatus_name = '未分配';
} else if ($v['itemStatus'] == 2) {
$itemStatus_name = '已分配';
}
$jsondata = $v['jsondata'] ? json_decode($v['jsondata'], true) : [];
$jsondata['mileage'] && $mileage = $jsondata['mileage'];
if ($jsondata['car_img']) {
foreach ($carImgAry as $key2 => $value2) {
$src = $jsondata['car_img'][$key2];
$src && $car_img[] = ['title' => $value2, 'src' => build_qiniu_image_url($src)];
}
}
$in_time = $v['in_time'];
if ($where_logs) {
$re_logs = $this->mdItemsOplogs->max('com_time', $where_logs);
$re_logs['com_time'] && $in_time = $re_logs['com_time'];
}
$lists[] = ['item_id' => $v['item_id'], 'title' => $title, 'vin' => $v['vin'], 'address' => $address,
'itemStatus_name' => $itemStatus_name, 'status_name' => $statusAry[$v['status']], 'mileage' => $mileage, 'car_img' => $car_img,
'in_time' => '0000-00-00 00:00:00' == $in_time ? '' : substr($in_time, 0, 10)];
}
}
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['autoList'] = $autoList;
$this->data['showInfo'] = ['statusAry' => $statusAry, 'itemStatusAry' => [1 => '未分配', 2 => '已分配', 3 => '已销售']];
$this->data['_title'] = '盘点(' . date('Y-m-d', $re['c_time']) . ")详情";
$this->show_view('items/inventory/lists_log', true);
}
public function get()
{
}
public function add()
{
$c_time = time();
$inve_id = $this->mdInventory->add(['c_time' => $c_time]);
if (!$inve_id) {
return $this->show_json(SYS_CODE_FAIL, '发起盘点失败');
}
$where = array('status>' => 0, 'bill_time' => '0000-00-00 00:00:00');
$res = $this->mdItems->select($where, 'id asc', 0, 0, 'id,biz_id,addr_id');
$addDate = [];
foreach ($res as $key => $value) {
$addDate[] = ['inve_id' => $inve_id, 'item_id' => $value['id'], 'biz_id' => $value['biz_id'], 'addr_id' => $value['addr_id'], 'c_time' => $c_time];
}
$counts = count($addDate);
if ($counts) {
$ret = $this->mdInventoryLog->add_batch($addDate);
if (!$ret) {
return $this->show_json(SYS_CODE_FAIL, '发起盘点失败');
}
}
return $this->show_json(SYS_CODE_SUCCESS, '发起盘点成功');
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
}
+153
View File
@@ -0,0 +1,153 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:库存车辆
* Created on: 2022/4/02 16:43
* Created by: dengbw
*/
class Stock extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('items/items_stock_log_model', 'mdStockLog');
$this->load->model('items/items_model', 'mdItems');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('area_model', 'mdArea');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $where = [];
$params['days_sort'] = $params['days_sort'] ? $params['days_sort'] : '';
if ($params['days_sort']) {
$order = $params['days_sort'] == 1 ? 'stay_days desc,id desc' : 'stay_days asc,id desc';
} else {
$order = "id desc";
}
if ($params['brand_id']) {
$where['brand_id'] = $params['brand_id'];
}
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
}
if ($params['vin']) {
$where["item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["biz_id in ({$str_ids})"] = null;
} else {
$where['biz_id'] = -2;
}
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['biz_id'] = '';
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["log_date>="] = $time[0];
$time[1] && $where["log_date<="] = $time[1];
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), "id desc", 0, 0, 'id,name');
if ($params['brand_id']) {
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
$total = $this->mdStockLog->count($where);
if ($total) {
$res = $this->mdStockLog->select($where, $order, $params['page'], $params['size']);
$brand_ids = $s_ids = $biz_ids = $item_ids = array();
foreach ($res as $v) {
$v['brand_id'] && !in_array($v['brand_id'], $brand_ids) && $brand_ids[] = $v['brand_id'];
$v['s_id'] && !in_array($v['s_id'], $s_ids) && $s_ids[] = $v['s_id'];
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
$v['item_id'] && !in_array($v['item_id'], $item_ids) && $item_ids[] = $v['item_id'];
}
$map_brand = $map_sery = $map_biz = $map_item = array();
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
}
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$map_sery = $this->mdAutoSeries->map('id', 'name', ["id in ({$str_ids})" => null]);
}
if ($biz_ids) {
$str_ids = implode(',', $biz_ids);
$map_biz = $this->mdBiz->map('id', 'biz_name', ["id in ({$str_ids})" => null]);
}
if ($item_ids) {
$str_ids = implode(',', $item_ids);
$map_item = $this->mdItems->map('id', 'vin', ["id in ({$str_ids})" => null]);
}
foreach ($res as $v) {
$address = $map_biz[$v['biz_id']];
$re_biz = $this->mdBiz->get(array('id' => $v['biz_id']));
if ($re_biz['county_id']) {
$re_area = $this->mdArea->get(array('county_id' => $re_biz['county_id']));
$re_area && $address = "{$re_area['city_name']} {$re_area['county_name']} {$address}";
} else if ($re_biz['city_id']) {
$re_area = $this->mdArea->get(array('city_id' => $re_biz['city_id']));
$re_area && $address = "{$re_area['city_name']} {$address}";
}
$title = "{$map_brand[$v['brand_id']]}-{$map_sery[$v['s_id']]}";
$vin = $map_item[$v['item_id']];
$in_time = !$v['in_time'] || '0000-00-00 00:00:00' == $v['in_time'] ? '' : substr($v['in_time'], 0, 10);
$lists[] = ['item_id' => $v['item_id'], 'title' => $title, 'vin' => $vin, 'in_time' => $in_time, 'address' => $address
, 'log_date' => $v['log_date'], 'stay_days' => $v['stay_days']];
}
}
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['autoList'] = $autoList;
$this->data['params'] = $params;
$this->data['_title'] = "库存车辆日志";
$this->show_view('items/stock/lists', true);
}
public function get()
{
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+446
View File
@@ -0,0 +1,446 @@
<?php
/**
* Notes:商品操作日志
* Created on: 2021/11/5 11:56
* Created by: dengbw
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Logs extends HD_Controller
{
private $statusAry = array(1 => '未分配', 2 => '已分配', 0 => '下架');
private $soldAry = array(1 => '未出售', 2 => '已出售');
public function __construct()
{
parent::__construct();
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$this->load->model('items/items_oplogs_model', 'mdItemsOplogs');
$this->load->model('items/items_model', 'mdItems');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model("sys/sys_addr_model", 'mdAddr');
$this->load->model('area_model', 'mdArea');
$this->load->model('items/items_relate_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$this->data = $this->dataSelect($params);
return $this->show_view('/items/logs/lists', true);
}
private function dataSelect($params)
{
$lists = $autoList = array();
$where = array('id<>1' => null, 'status>' => 0);
if ($params['brand_id']) {
$where['brand_id'] = $params['brand_id'];
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
}
//车身颜色
if ($params['cor_id']) {
$where['cor_id'] = $params['cor_id'];
} else {
$params['cor_id'] = '';
}
//地址筛选
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
}
if ($params['biz_id'] == -1 && $params['addr_id']) {
$where['addr_id'] = $params['addr_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["biz_id in ({$str_ids})"] = null;
} else {
$where['biz_id'] = -2;
}
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['addr_id'] = '';
$params['biz_id'] = '';
}
if (strlen($params['status']) > 0) {
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
if ($params['vin']) {
$where["vin like '%{$params['vin']}%'"] = null;
}
if ($params['sold'] == 1) {
$where["bill_time"] = '0000-00-00 00:00:00';
} else if ($params['sold'] == 2) {
$where["bill_time<>"] = '0000-00-00 00:00:00';
} else {
$params['sold'] = '';
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$statusAry = $this->statusAry;
$soldAry = $this->soldAry;
$count = $this->mdItems->count($where);
if ($count) {
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,status';
$orderby = "id desc";
$rows = $this->mdItems->select($where, $orderby, $params['page'], $params['size'], $fileds);
$brand_ids = $s_ids = $attr_vids = $attr_corids = $biz_ids = $addr_ids = array();
$ids = array();
foreach ($rows as $v) {
$ids[] = $v['id'];
$v['brand_id'] && !in_array($v['brand_id'], $brand_ids) && $brand_ids[] = $v['brand_id'];
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
$v['addr_id'] && !in_array($v['addr_id'], $addr_ids) && $addr_ids[] = $v['addr_id'];
$v['s_id'] && !in_array($v['s_id'], $s_ids) && $s_ids[] = $v['s_id'];
$v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id'];
$v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id'];
}
$map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$where = array("id in ({$str_ids})" => null);
$map_brand = $this->mdAutoBrand->map('id', 'name', $where);
}
if ($s_ids) {
$str_ids = implode(',', $s_ids);
$where = array("id in ({$str_ids})" => null);
$map_sery = $this->mdAutoSeries->map('id', 'name', $where);
}
if ($attr_vids) {
$str_ids = implode(',', $attr_vids);
$where = array("id in ({$str_ids})" => null);
$map_vid = $this->mdAutoAttr->map('id', 'title', $where);
}
if ($attr_corids) {
$str_ids = implode(',', $attr_corids);
$where = array("id in ({$str_ids})" => null);
$map_corid = $this->mdAutoAttr->map('id', 'title', $where);
}
if ($biz_ids) {
$str_ids = implode(',', $biz_ids);
$where = array("id in ({$str_ids})" => null);
$map_biz = $this->mdBiz->map('id', 'biz_name', $where);
}
if ($addr_ids) {
$str_ids = implode(',', $addr_ids);
$where = array("id in ({$str_ids})" => null);
$orderby = 'id desc';
$select = 'id, title, city_name, county_name';
$rows_addr = $this->mdAddr->select($where, $orderby, 0, 0, $select);
foreach ($rows_addr as $v) {
$map_addr[$v['id']] = ['title' => "{$v['city_name']} {$v['county_name']} 其它 {$v['title']}", 'name' => $v['title']];
}
}
foreach ($rows as $k => $v) {
$address = $last_db_time = $inventory_time = $biz_name = '';
$log_max = $log_min_kc = $log_max_kc = [];
if ($v['biz_id'] > 0) {
$address = $map_biz[$v['biz_id']];
$biz_name = $map_biz[$v['biz_id']];
$re_biz = $this->mdBiz->get(array('id' => $v['biz_id']));
if ($re_biz['county_id']) {
$re_area = $this->mdArea->get(array('county_id' => $re_biz['county_id']));
$re_area && $address = "{$re_area['city_name']} {$re_area['county_name']} {$address}";
} else if ($re_biz['city_id']) {
$re_area = $this->mdArea->get(array('city_id' => $re_biz['city_id']));
$re_area && $address = "{$re_area['city_name']} {$address}";
}
$log_max = $this->mdItemsOplogs->max('com_time', ["type in(1,2) AND item_id={$v['id']}
AND (biz_id={$v['biz_id']} or biz_id_to={$v['biz_id']})" => null]);
$log_min_kc = $this->mdItemsOplogs->get(["item_id={$v['id']}
AND (biz_id={$v['biz_id']} or biz_id_to={$v['biz_id']})" => null], 'com_time');
$log_max_kc = $this->mdItemsOplogs->max('com_time', ["item_id={$v['id']}
AND (biz_id={$v['biz_id']} or biz_id_to={$v['biz_id']})" => null]);
} else if ($v['biz_id'] == -1 && $v['addr_id']) {
$address = $map_addr[$v['addr_id']]['title'];
$biz_name = $map_addr[$v['addr_id']]['name'];
$log_max = $this->mdItemsOplogs->max('com_time', ["type in(1,2) AND item_id={$v['id']}
AND (addr_id={$v['addr_id']} or addr_id_to={$v['addr_id']})" => null]);
$log_min_kc = $this->mdItemsOplogs->get(["item_id={$v['id']}
AND (addr_id={$v['addr_id']} or addr_id_to={$v['addr_id']})" => null], 'com_time');
$log_max_kc = $this->mdItemsOplogs->max('com_time', ["item_id={$v['id']}
AND (addr_id={$v['addr_id']} or addr_id_to={$v['addr_id']})" => null]);
}
($log_max['com_time'] && '0000-00-00 00:00:00' != $log_max['com_time']) && $last_db_time = $log_max['com_time'];
if (!$last_db_time && $v['in_time'] != '0000-00-00 00:00:00') {
$last_db_time = $v['in_time'];
}
$days = 0;
if (($log_min_kc['com_time'] && $log_max_kc['com_time']) && ($log_min_kc['com_time'] != $log_max_kc['com_time'])) {
$days = round((strtotime($log_max_kc['com_time']) - strtotime($log_min_kc['com_time'])) / 3600 / 24);
} else if ($v['in_time'] != '0000-00-00 00:00:00' && $v['bill_time'] != '0000-00-00 00:00:00') {
$days = round((strtotime($v['bill_time']) - strtotime($v['in_time'])) / 3600 / 24);
} else if ($v['in_time'] != '0000-00-00 00:00:00') {
$days = round((time() - strtotime($v['in_time'])) / 3600 / 24);
}
if ($days > 0) {
$inventory_time = '库存' . $days . '天';
} else if ($v['in_time'] != '0000-00-00 00:00:00' && $v['bill_time'] == '0000-00-00 00:00:00') {
$inventory_time = '当天库存';
} else if ($v['in_time'] != '0000-00-00 00:00:00') {
$inventory_time = '当天售出';
}
$title = "{$map_brand[$v['brand_id']]}-{$map_sery[$v['s_id']]}-{$map_vid[$v['v_id']]}-{$map_corid[$v['cor_id']]}";
$lists[] = array(
'id' => $v['id'],
'title' => $title,
'biz_name' => $biz_name,
'vin' => $v['vin'],
'address' => $address,
'in_time' => '0000-00-00 00:00:00' != $v['in_time'] ? date('Y-m-d', strtotime($v['in_time'])) : '',
'status_name' => $statusAry[$v['status']],
'bill_time' => '0000-00-00 00:00:00' != $v['bill_time'] ? $soldAry[2] : $soldAry[1],
'last_db_time' => $last_db_time,
'inventory_time' => $inventory_time,
);
}
}
unset($statusAry[0]);
$data['lists'] = $lists;
$data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$data['params'] = $params;
$data['autoList'] = $autoList;
$data['statusAry'] = $statusAry;
$data['soldAry'] = $soldAry;
$data['_title'] = '调拨记录';
return $data;
}
public function get()
{
$id = $this->input->get('id');
$re = $this->mdItems->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '商品不存在!');
}
$title = $this->input->get('title');
$biz_name = $this->input->get('biz_name');
$res_log = $this->mdItemsOplogs->select(array('item_id' => $id), 'id asc', 0, 0);
$biz_ids = $biz_ids_to = $addr_ids = $addr_ids_to = array();
foreach ($res_log as $v) {
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
$v['biz_id_to'] && !in_array($v['biz_id_to'], $biz_ids_to) && $biz_ids_to[] = $v['biz_id_to'];
$v['addr_id'] && !in_array($v['addr_id'], $addr_ids) && $addr_ids[] = $v['addr_id'];
$v['addr_id_to'] && !in_array($v['addr_id_to'], $addr_ids_to) && $addr_ids_to[] = $v['addr_id_to'];
}
$map_biz = $map_addr = array();
if ($biz_ids || $biz_ids_to) {
if ($biz_ids && $biz_ids_to) {
$biz_ids = array_merge($biz_ids, $biz_ids_to);
} else if ($biz_ids_to) {
$biz_ids = $biz_ids_to;
}
$str_ids = implode(',', $biz_ids);
$where = array("id in ({$str_ids})" => null);
$rows_biz = $this->mdBiz->select($where, 'id desc', 0, 0, 'id,biz_name,city_id,county_id');
foreach ($rows_biz as $v) {
$address = $v['biz_name'];
if ($v['county_id']) {
$re_area = $this->mdArea->get(array('county_id' => $v['county_id']));
$re_area && $address = "{$re_area['city_name']} {$re_area['county_name']} {$address}";
} else if ($v['city_id']) {
$re_area = $this->mdArea->get(array('city_id' => $v['city_id']));
$re_area && $address = "{$re_area['city_name']} {$address}";
}
$map_biz[$v['id']] = ['title' => $v['biz_name'], 'address' => $address];
}
}
if ($addr_ids || $addr_ids_to) {
if ($addr_ids && $addr_ids_to) {
$addr_ids = array_merge($addr_ids, $addr_ids_to);
} else if ($addr_ids_to) {
$addr_ids = $addr_ids_to;
}
$str_ids = implode(',', $addr_ids);
$where = array("id in ({$str_ids})" => null);
$rows_addr = $this->mdAddr->select($where, 'id desc', 0, 0, 'id, title, city_name, county_name');
foreach ($rows_addr as $v) {
$address = "{$v['city_name']} {$v['county_name']} {$v['title']}";
$map_addr[$v['id']] = ['title' => $v['title'], 'address' => $address];
}
}
$typeAry = $this->mdItemsOplogs->typeAry();
$lists = array();
foreach ($res_log as $key => $value) {
$setValue = array();
$log = '';
if ($value['type'] == 1) {
$log = '[' . $value['com_time'] . '] 入库';
if ($value['biz_id'] > 0) {
$log .= ',存放门店 [' . $map_biz[$value['biz_id']]['address'] . ']';
} elseif ($value['addr_id']) {
$log .= ',存放地址 [' . $map_addr[$value['addr_id']]['address'] . ']';
} else {
$log .= ',未选择存放地';
}
} else if ($value['type'] == 2) {
if ($value['biz_id'] > 0 && $value['biz_id_to'] > 0) {
$log = '从 [' . $map_biz[$value['biz_id']]['address'] . '] 调拨到 [' . $map_biz[$value['biz_id_to']]['address'] . ']';
} else if ($value['biz_id'] > 0 && $value['addr_id_to']) {
$log = '从 [' . $map_biz[$value['biz_id']]['address'] . '] 调拨到 [' . $map_addr[$value['addr_id_to']]['address'] . ']';
} else if ($value['addr_id'] && $value['biz_id_to'] > 0) {
$log = '从 [' . $map_addr[$value['addr_id']]['address'] . '] 调拨到 [' . $map_biz[$value['biz_id_to']]['address'] . ']';
} else if ($value['addr_id'] && $value['addr_id_to']) {
$log = '从 [' . $map_addr[$value['addr_id']]['address'] . '] 调拨到 [' . $map_addr[$value['addr_id_to']]['address'] . ']';
}
} else if ($value['type'] == 3) {
$log = '[' . $value['com_time'] . '] 开票';
if ($value['biz_id'] > 0) {
$log .= ',出售门店 [' . $map_biz[$value['biz_id']]['address'] . ']';
} elseif ($value['addr_id']) {
$log .= ',出售地址 [' . $map_addr[$value['addr_id']]['address'] . ']';
} else {
$log .= ',未选择出售地';
}
}
$setValue['log'] = $log;
$setValue['uname'] = $value['uname'];
$setValue['type_name'] = $typeAry[$value['type']];
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
if ($value['biz_id_to'] > 0) {
$map_biz[$value['biz_id_to']]['lists'][] = $setValue;
}
if ($value['biz_id'] > 0) {
if ($value['biz_id_to'] > 0) {
if ($map_biz[$value['biz_id']]['s_time'] > 0) {
$days = round((strtotime($value['com_time']) - strtotime($map_biz[$value['biz_id']]['s_time'])) / 3600 / 24);
$setValue['log'] = $setValue['log'] . ',库存' . $days . '天';
}
$value['com_time'] != '0000-00-00 00:00:00' && $map_biz[$value['biz_id_to']]['s_time'] = $value['com_time'];
} else {
if ($value['type'] == 3 && $map_biz[$value['biz_id']]['s_time'] > 0) {
$days = round((strtotime($value['com_time']) - strtotime($map_biz[$value['biz_id']]['s_time'])) / 3600 / 24);
$setValue['log'] = $setValue['log'] . ',用时' . $days . '天出售车辆';
}
$value['com_time'] != '0000-00-00 00:00:00' && $map_biz[$value['biz_id']]['s_time'] = $value['com_time'];
}
$map_biz[$value['biz_id']]['lists'][] = $setValue;
}
if ($value['addr_id_to'] > 0) {
$map_addr[$value['addr_id_to']]['lists'][] = $setValue;
}
if ($value['addr_id'] > 0) {
if ($value['biz_id_to'] > 0) {
if ($map_addr[$value['addr_id']]['s_time'] > 0) {
$days = round((strtotime($value['com_time']) - strtotime($map_addr[$value['addr_id']]['s_time'])) / 3600 / 24);
$setValue['log'] = $setValue['log'] . ',库存' . $days . '天';
}
$value['com_time'] != '0000-00-00 00:00:00' && $map_addr[$value['addr_id_to']]['s_time'] = $value['com_time'];
} else {
if ($value['type'] == 3 && $map_addr[$value['addr_id']]['s_time'] > 0) {
$days = round((strtotime($value['com_time']) - strtotime($map_addr[$value['addr_id']]['s_time'])) / 3600 / 24);
$setValue['log'] = $setValue['log'] . ',用时' . $days . '天出售车辆';
}
$value['com_time'] != '0000-00-00 00:00:00' && $map_addr[$value['addr_id']]['s_time'] = $value['com_time'];
}
$map_addr[$value['addr_id']]['lists'][] = $setValue;
}
$lists[] = $setValue;
}
$all = array('lists' => $lists);
if ($re['in_time'] != '0000-00-00 00:00:00' && $re['bill_time'] != '0000-00-00 00:00:00') {
$days = round((strtotime($re['bill_time']) - strtotime($re['in_time'])) / 3600 / 24);
$all['title'] = "总用时{$days}天出售车辆";
} else if ($re['in_time'] != '0000-00-00 00:00:00') {
$days = round((time() - strtotime($re['in_time'])) / 3600 / 24);
$all['title'] = "至今已库存{$days}";
}
$lists = array();
foreach ($map_biz as $key => $value) {
if ($biz_name) {
if ($value['title'] == $biz_name) {
$lists[] = $value;
}
} else {
$lists[] = $value;
}
}
foreach ($map_addr as $key => $value) {
if ($biz_name) {
if ($value['title'] == $biz_name) {
$lists[] = $value;
}
} else {
$lists[] = $value;
}
}
$this->data['all'] = $all;
$this->data['lists'] = $lists;
$this->data['biz_name'] = $biz_name;
$this->data['_title'] = $title;
return $this->show_view('/items/logs/get', true);
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->dataSelect($params);
$fileName = $res['_title'];
foreach ($res['lists'] as $key => $value) {
$temp['address'] = $value['address'];
$temp['title'] = $value['title'];
$temp['vin'] = $value['vin'];
$temp['in_time'] = $value['in_time'];
$temp['last_db_time'] = $value['last_db_time'];
$temp['inventory_time'] = $value['inventory_time'];
$temp['bill_time'] = $value['bill_time'];
$temp['status_name'] = $value['status_name'];
$data[] = $temp;
}
$indexs = [
'address' => '门店',
'title' => '车辆',
'vin' => '车架号',
'in_time' => '入库日期',
'last_db_time' => '最后调拨时间',
"inventory_time" => "库存时间",
"bill_time" => "是否出售",
"status_name" => "状态",
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+340
View File
@@ -0,0 +1,340 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:保利威直播
* Created on: 2021/12/6 16:43
* Created by: dengbw
*/
class Polyv extends HD_Controller
{
private $channelId = '2810581';
public function __construct()
{
parent::__construct();
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
$this->load->model('live/Live_polyv_viewlog_model', 'mdPolyvViewlog');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = [];
$where = ['channelId' => $this->channelId];
if ($params['sessionId']) {
$where["sessionId"] = $params['sessionId'];
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["startTime>="] = strtotime($time[0] . ' 00:00:00') * 1000;
$time[1] && $where["endTime<="] = strtotime($time[1] . ' 23:59:59') * 1000;
}
$total = $this->mdPolyvSession->count($where);
if ($total) {
$res = $this->mdPolyvSession->select($where, "startTime desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = $value;
$setValue['duration'] = $value['duration'] ? ceil($value['duration'] / 60) : '0';
$setValue['totalPlayDuration'] = $value['totalPlayDuration'] ? ceil($value['totalPlayDuration'] / 60) : '0';
$setValue['startTime'] = $value['startTime'] ? date('Y-m-d H:i:s', $value['startTime'] / 1000) : '';
$setValue['endTime'] = $value['endTime'] ? date('Y-m-d H:i:s', $value['endTime'] / 1000) : '';
$setValue['viewlog_time'] = $value['viewlog_time'] != '0000-00-00 00:00:00'
? date('Y-m-d H:i', strtotime($value['viewlog_time'])) : '未同步';
$setValue['session_time'] = date('Y-m-d H:i', strtotime($value['session_time']));
$lists[] = $setValue;
}
}
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = "保利威频道({$this->channelId})_场次报表";
$this->show_view('live/polyv/lists', true);
}
public function lists_viewlog()
{
$params = $this->input->get();
if (!$params['sessionId']) {
return $this->show_json(SYS_CODE_FAIL, '场次ID不能为空!');
}
$menuAry = [];
$re_session = $this->mdPolyvSession->get(['channelId' => $this->channelId, 'sessionId' => $params['sessionId']]);
if (!$re_session) {
return $this->show_json(SYS_CODE_FAIL, '无此场次数据!');
}
$re_session['startTime'] = $re_session['startTime'] ? date('Y-m-d H:i:s', $re_session['startTime'] / 1000) : '';
!$params['param3'] && $params['param3'] = 'live';
if ($params['param3'] == 'live') {
$re_session['duration'] = $re_session['duration'] ? ceil($re_session['duration'] / 60) : '0';
$re_session['totalPlayDuration'] = $re_session['totalPlayDuration'] ? ceil($re_session['totalPlayDuration'] / 60) : '0';
$watch_duration = $re_session['totalPlayDuration'] && $re_session['liveUV'] ? $re_session['totalPlayDuration'] / $re_session['liveUV'] : '0';
$menuAry = [['title' => '直播时长(分钟)', 'value' => $re_session['duration'], 'tag' => '讲师该场直播直播时间']
, ['title' => '观看人数', 'value' => $re_session['liveUV'], 'tag' => '观看人数为观看用户总数,计算方式为观看记录根据用户id去重的条目数']
, ['title' => '观看次数', 'value' => $re_session['livePV'], 'tag' => '观看次数为观看记录条目数,用户刷新页面或者离开再进入直播,记为2条观看记录']
, ['title' => '观看时长', 'value' => $re_session['totalPlayDuration'], 'tag' => '观看时长是根据每条观看记录向上取整(不足1分钟按1分钟计算),最后再相加后的结果。例如:单条观看记录时长为1分36秒,统计时会计算为2分钟。']
, ['title' => '人均观看时长', 'value' => $watch_duration, 'tag' => '人均观看时长=累计观看时长/观看人数,单位:分钟']
];
} else if ($params['param3'] == 'vod') {
$re_sum = $this->mdPolyvViewlog->sum('stayDuration', ['param3' => 'vod', 'channelId' => $this->channelId, 'sessionId' => $params['sessionId']]);
$duration = $re_sum['stayDuration'] ? ceil($re_sum['stayDuration'] / 60) : '0';
$menuAry = [['title' => '回看时长(分钟)', 'value' => $duration, 'tag' => '观看时长是根据每条观看记录向上取整(不足1分钟按1分钟计算),最后再相加后的结果。例如:单条观看记录时长为1分36秒,统计时会计算为2分钟。']
, ['title' => '回看人数', 'value' => $re_session['playbackUV'], 'tag' => '回看人数为观看次数针对userid和时间去重,如果一个人连续2天都有观看,记为1次']
, ['title' => '回看次数', 'value' => $re_session['playbackPV'], 'tag' => '回看次数为该场次暂存列表和回放列表观看记录汇总']
];
}
$results = $this->dataSelect($params);
$this->data['lists'] = $results['lists'];
$this->data['params'] = $results['params'];
$this->data['pager'] = $results['pager'];
$this->data['_title'] = $results['_title'];
$this->data['menuAry'] = $menuAry;
$this->data['info'] = $re_session;
$this->show_view('live/polyv/lists_viewlog', true);
}
private function dataSelect($params)
{
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['param3'] = $params['param3'] ? $params['param3'] : 'live';
$params['merge'] = $params['merge'] ? $params['merge'] : '';
$lists = $menuAry = [];
$where = ['channelId' => $this->channelId, 'sessionId' => $params['sessionId'], 'param3' => $params['param3']];
if ($params['merge']) {
$total = $this->mdPolyvViewlog->count($where, 'param1');
} else {
$total = $this->mdPolyvViewlog->count($where);
}
if ($total) {
$fileds = '';
$params['size'] == 10000 && $fileds = 'param3,city,isMobile,referer,param4,param5,sessionId,';//导出
if ($params['merge']) {
$fileds .= 'param1,param2,createdTime,sum(playDuration) as playDuration,browser,ipAddress,province';
$res = $this->mdPolyvViewlog->select_groupby('param1', $where, "createdTime desc", $params['page'], $params['size'], $fileds);
} else {
$fileds .= 'param1,param2,createdTime,playDuration,browser,ipAddress,province';
$res = $this->mdPolyvViewlog->select($where, "createdTime desc", $params['page'], $params['size'], $fileds);
}
foreach ($res as $key => $value) {
$setValue = $value;
$setValue['createdTime'] = date('Y-m-d H:i:s', $value['createdTime'] / 1000);
$playDuration = '0';
if ($value['playDuration']) {
$format = $value['playDuration'] >= 3600 || $params['size'] == 10000 ? 'H:i:s' : 'i:s';//大1小时
$playDuration = gmdate($format, $value['playDuration']);
}
$setValue['playDuration'] = $playDuration;
$lists[] = $setValue;
}
}
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$data['lists'] = $lists;
$data['params'] = $params;
$data['_title'] = "观看日志统计";
return $data;
}
/**
* Notes:同步保利威分页查询频道直播观看详情数据
* Created on: 2022/2/14 14:38
* Created by: dengbw
* @return bool
*/
public function api_viewlog()
{
$sessionIds = $this->input->post('sessionid');
$params['sessionIds'] = $sessionIds;
if (!$params['sessionIds']) {
return $this->show_json(SYS_CODE_FAIL, '场次ID不能为空!');
}
$re_session = $this->mdPolyvSession->get(['channelId' => $this->channelId, 'sessionId' => $params['sessionIds']]);
if (!$re_session) {
return $this->show_json(SYS_CODE_FAIL, '无此场次数据!');
}
if ($re_session['viewlog_time'] != '0000-00-00 00:00:00') {
$startTime = strtotime($re_session['viewlog_time']);
} else {
$startTime = $re_session['startTime'] / 1000;
}
$endTime = strtotime(date('Y-m-d H:i:s'));
//不同月份时开始取本月第1天
if (date('m', $startTime) != date('m', $endTime)) {
$startTime = strtotime(date('Y-m', time()) . '-01 00:00:00');
}
$params['startTime'] = $startTime * 1000;
$params['endTime'] = $endTime * 1000;
$params['page'] = 1;
$results = $this->getViewLog($params);
// $this->data['params'] = $params;
// $this->data['results'] = $results;
$message = $results['message'];
if ($results['status'] == 'success') {
$i = 10;
while (($i--) > 0) {
if ($results['status'] == 'success' && !$results['lastPage']
&& $results['pageNumber'] != $results['nextPageNumber']) {
$params['page'] = $results['nextPageNumber'];
$results = $this->getViewLog($params);
continue;
} else {
break;
}
}
//同步观看数据时间
$this->mdPolyvSession->update(['viewlog_time' => date('Y-m-d H:i:s', $endTime)], ['id' => $re_session['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
} else {
return $this->show_json(SYS_CODE_FAIL, $message);
}
}
private function getViewLog($params)
{
$this->load->library('PolyvApi');
$polyv = new PolyvApi(['channel_id' => $this->channelId]);
$results = $polyv->getViewLog($params);
if ($results['status'] == 'success') {
$addData = [];
foreach ($results['data']['contents'] as $key => $value) {
$re = $this->mdPolyvViewlog->get(['playId' => $value['playId']]);
$data = [
'channelId' => $value['channelId'], 'sessionId' => $value['sessionId'], 'playId' => $value['playId'],
'userId' => $value['userId'], 'playDuration' => $value['playDuration'], 'stayDuration' => $value['stayDuration'],
'flowSize' => $value['flowSize'], 'param1' => $value['param1'], 'param2' => $value['param2'],
'param3' => $value['param3'], 'param4' => $value['param4'], 'param5' => $value['param5'], 'ptype' => $value['ptype'],
'ipAddress' => $value['ipAddress'], 'country' => $value['country'], 'province' => $value['province'],
'city' => $value['city'], 'isp' => $value['isp'], 'referer' => $value['referer'], 'userAgent' => $value['userAgent'],
'operatingSystem' => $value['operatingSystem'], 'browser' => $value['browser'], 'isMobile' => $value['isMobile'],
'currentDay' => $value['currentDay'], 'createdTime' => $value['createdTime'], 'lastModified' => $value['lastModified'],
];
if ($re) {//同步更新数据
$this->mdPolyvViewlog->update($data, ['id' => $re['id']]);
} else {//新增
$data['c_time'] = time();
$addData[] = $data;
}
}
if ($addData && count($addData)) {//新增数据
$this->mdPolyvViewlog->add_batch($addData);
}
}
return $results;
}
/**
* Notes:同步保利威频道多场次概览统计数据
* Created on: 2022/2/11 16:50
* Created by: dengbw
* @return bool
*/
public function api_session()
{
$params = $this->input->post();
$where = [];
$params['sessionId'] && $where['sessionIds'] = $params['sessionId'];
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["startTime"] = strtotime($time[0] . ' 00:00:00') * 1000;
$time[1] && $where["endTime"] = strtotime($time[1] . ' 23:59:59') * 1000;
}
$this->load->library('PolyvApi');
$polyv = new PolyvApi(['channel_id' => $this->channelId]);
$results = $polyv->getSessionStats($where);
if ($results['status'] == 'success') {
foreach ($results['data']['list'] as $key => $value) {
$re = $this->mdPolyvSession->get(['channelId' => $this->channelId, 'sessionId' => $value['sessionId']]);
$data = [
'channelId' => $value['channelId'], 'sessionId' => $value['sessionId'], 'name' => $value['name'],
'startTime' => $value['startTime'], 'endTime' => $value['endTime'], 'duration' => $value['duration'],
'liveUV' => $value['liveUV'], 'livePV' => $value['livePV'], 'playbackUV' => $value['playbackUV'],
'playbackPV' => $value['playbackPV'], 'totalPlayDuration' => $value['totalPlayDuration'],
'session_time' => date('Y-m-d H:i:s'),
];
if ($re) {//同步更新数据
$this->mdPolyvSession->update($data, ['id' => $re['id']]);
} else {//新增
$data['c_time'] = time();
$this->mdPolyvSession->add($data);
}
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
} else {
return $this->show_json(SYS_CODE_FAIL, $results['message']);
}
}
public function get()
{
}
public function add()
{
}
public function edit()
{
}
public function del()
{
}
public function batch()
{
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->dataSelect($params);
$fileName = $res['_title'];
foreach ($res['lists'] as $key => $value) {
$temp['playDuration'] = $value['playDuration'];
$temp['param1'] = $value['param1'];
$temp['param2'] = $value['param2'];
$temp['param3'] = $value['param3'] == 'live' ? '直播' : '回放';
$temp['createdTime'] = $value['createdTime'];
$temp['ipAddress'] = $value['ipAddress'];
$temp['province'] = $value['province'];
$temp['city'] = $value['city'];
$temp['browser'] = $value['browser'];
$temp['isMobile'] = $value['isMobile'] == 'Y' ? '是' : '否';
$temp['referer'] = $value['referer'];
$temp['param4'] = $value['param4'];
$temp['param5'] = $value['param5'];
$temp['sessionId'] = $value['sessionId'];
$data[] = $temp;
}
$indexs = [
'playDuration' => '观看时长',
'param1' => '用户ID',
'param2' => '昵称',
'param3' => '观看类型',
'createdTime' => '开始时间',
"ipAddress" => "观众IP",
"province" => "地区",
"city" => "城市",
"browser" => "浏览器类型",
"isMobile" => "是否移动端",
"referer" => "观看地址",
"param4" => "param4",
"param5" => "param5",
"sessionId" => "场次ID",
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+162
View File
@@ -0,0 +1,162 @@
<?php
/**
* Notes:订单管理
* Created on: 2019/12/12 13:46
* Created by: dengbw
*/
defined('BASEPATH') OR exit('No direct script access allowed');
Class Purchase extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('app/app_model');
$this->load->model('apporder/order_purchase_model');
$this->load->service('apporder/order_service');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$searchAry = array(
'sid' => '订单号',
'uname' => '买家姓名',
'mobile' => '买家手机号',
'item_title' => '标题',
'app_uid' => '用户ID'
);
$statusAry = $this->order_service->statusAry();
$statusDAry = $this->order_service->statusDetailAry();
$paywayAry = $this->order_service->paywayAry();
$where = array('app_id' => $params['app_id']);
if($params['search_v']){
switch($params['search_k']){
case 'uname':
case 'mobile':
case 'item_title':
$where["{$params['search_k']} like '%{$params['search_v']}%'"] = null;
break;
default:
$where[$params['search_k']] = $params['search_v'];
}
}
!$params['search_k'] && $params['search_k'] = 'sid';
if($params['status']){
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
if($params['status_detail']){
$where['status_detail'] = $params['status_detail'];
} else{
$params['status_detail'] = '';
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
if (strlen($params['payway']) > 0) {
$where['payway'] = $params['payway'];
} else {
$params['payway'] = '';
}
$total = $this->order_purchase_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id,sid,item_title,item_num,item_price,total_price,pay_price,
uname,mobile,payway,status,status_detail,c_time,type,app_id';
$rows = $this->order_purchase_model->select($where, $orderby, $params['page'], $params['size'], $select);
foreach($rows as $v){
$opt = [];
if($v['status']==1 && $v['status_detail']==11 && $v['app_id']==1 && $v['type']==4){ //定金未支付
$opt['action'] = '/order/purchase/edit_topay';
}
$lists[] = array(
'id' => $v['id'],
'sid' => $v['sid'],
'uname' => $v['uname'],
'mobile' => $v['mobile'],
'title' => $v['item_title'],
'c_time' => date('Y-m-d H:i:s', $v['c_time']),
'item_price_name' => "{$v['item_price']}*{$v['item_num']}",
'pay_price_name' => "{$v['pay_price']}",
'status_name' => $statusDAry[$v['status']][$v['status_detail']],
'payway_name' => $paywayAry[$v['payway']],
'opt' => $opt
);
}
}
$this->data['_title'] = '消费订单管理';
$this->data['searchAry'] = $searchAry;
$this->data['statusAry'] = $statusAry;
$this->data['statusDAry'] = $statusDAry;
$this->data['paywayAry'] = $paywayAry;
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
return $this->show_view('/order/purchase/lists', true);
}
public function get(){
// TODO: Implement get() method.
}
public function add(){
// TODO: Implement add() method.
}
public function edit(){
// TODO: Implement edit() method.
}
public function del(){
// TODO: Implement del() method.
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
//完成定金订单
public function edit_topay(){
$sid = $this->input->post('sid');
$row = $this->order_purchase_model->get(['sid'=>$sid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
$this->load->service('apporder/payment_service', array('app_id' => $row['app_id']));
$result = $this->payment_service->after_pay($sid);
if($result['code']){
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}else{
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
}
}
+718 -54
View File
@@ -1,26 +1,43 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Clues extends HD_Controller{
class Clues extends HD_Controller
{
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
private $cacheKeyPhone = 'xz_admin_phone';
protected $log_dir;
public function __construct(){
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_clues_model','clues_model');
$this->load->model('receiver/receiver_clues_cfrom_model','clues_cfrom_model');
$this->load->model('receiver/receiver_status_model','status_model');
$this->load->model('receiver/receiver_customers_model','customers_model');
$this->load->model('receiver/receiver_clues_model', 'clues_model');
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
$this->load->model('receiver/receiver_xz_model', 'mdReceiverXz');
$this->load->model('app/licheb/app_licheb_users_model');
$this->load->model("biz/biz_model");
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$this->load->model('area_model');
$this->log_dir = 'receiver_clues';
}
//首页信息
public function index(){
public function index()
{
$this->lists();
}
public function lists($where = array()){
public function lists($where = array())
{
$statusAry = $this->clues_model->statusAry();
$params = $this->input->get();
$this->data['city_id'] = $city_id = intval($params['city_id']);
$this->data['county_id'] = $county_id = intval($params['county_id']);
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
@@ -39,59 +56,463 @@ class Clues extends HD_Controller{
$where_yx["c.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
}
//最后报名时间
if ($params['en_time']) {
$en_time = explode(' ~ ', $params['en_time']);
if ($en_time[0]) {
$where["en_time >="] = $en_time[0] . ' 00:00:00';
$where_yx["c.en_time >="] = $en_time[0] . ' 00:00:00';
}
if ($en_time[1]) {
$where["en_time <="] = $en_time[1] . ' 23:59:59';
$where_yx["c.en_time <="] = $en_time[1] . ' 23:59:59';
}
}
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['status2']) && $where["status2"] = $params['status2'];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
} else {
$cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
}
}
$count = $this->clues_model->count($where);
$lists = [];
if($count){
$fileds = 'id,name,mobile,cf_id,status_id,c_time,admin_id';
$rows = $this->clues_model->select($where,'id desc',$page,$size,$fileds);
if ($count) {
$fileds = 'id,name,mobile,cf_id,c_time,admin_id,status,status2,en_time';
$rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds);
//获取来源
$cf_id_arr = array_unique(array_column($rows,'cf_id'));
$cf_rows = $this->clues_cfrom_model->get_map_by_ids($cf_id_arr,'id,title');
//获取状态
$status_id_arr = array_unique(array_column($rows,'status_id'));
$status_rows = $this->status_model->get_map_by_ids($status_id_arr,'id,name');
//获取销售员
$admin_id_arr = array_unique(array_column($rows,'admin_id'));
$admin_rows = $this->app_licheb_users_model->get_map_by_ids($admin_id_arr,'id,uname');
foreach($rows as $key => $val){
$cf_id_arr = array_unique(array_column($rows, 'cf_id'));
$cf_rows = $this->clues_cfrom_model->get_map_by_ids($cf_id_arr, 'id,title');
//获取管理员
$this->load->model('sys/sys_admin_model', 'admin_model');
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
if ($admin_id_arr) {
$str_ids = implode(',', $admin_id_arr);
$where = array("id in ({$str_ids})" => null);
$map_admin = $this->admin_model->map('id', 'username', $where);
}
foreach ($rows as $key => $val) {
$val['cf_title'] = isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : '';
$val['status_name'] = isset($status_rows[$val['status_id']]) ? $status_rows[$val['status_id']][0]['name'] : '';
$val['admin_name'] = isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '';
$status_name = $statusAry[$val['status']]['name'];
$val['status2'] && $status_name .= '' . $statusAry[$val['status']]['list'][$val['status2']];
$val['status_name'] = $status_name;
$val['admin_name'] = isset($map_admin[$val['admin_id']]) ? $map_admin[$val['admin_id']] : '';
if (SUPER_ADMIN == $this->role) {
$val['mobile_sub'] = $val['mobile'];
} else {
$val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
}
$lists[] = $val;
}
}
$statusList = array();
foreach ($this->clues_model->statusAry() as $key => $value) {
$cate = array();
$where = array("status" => $key);
$count1 = $this->clues_model->count($where);
if ($value['list']) {
foreach ($value['list'] as $key2 => $value2) {
$where['status2'] = $key2;
$count2 = $this->clues_model->count($where);
$cate[] = array("id" => $key2, "name" => $value2, "count" => $count2);
}
}
$statusList[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['searchTpAry'] = $this->searchTpAry;
$this->data['params'] = $params;
$this->data['statusList'] = $statusList;
$this->data['_title'] = '线索池列表';
return $this->show_view('receiver/clues/lists', true);
}
public function get(){
public function get()
{
$params = $this->input->get();
$id = intval($params['id']);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$statusList = $status2List = $logsList = [];
$re = $this->clues_model->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
}
$dataInfo = $re;
foreach ($this->clues_model->statusAry() as $key => $value) {
$statusList[] = array("id" => $key, "name" => $value['name']);
}
if (strlen($re['status'])) {
foreach ($this->clues_model->statusAry($re['status'])['list'] as $key => $value) {
$status2List[] = array("id" => $key, "name" => $value);
}
}
$dataInfo['editType'] = 0;
$re_cf = $this->clues_cfrom_model->get(array('id' => $re['cf_id']));
$info_show['cfrom_title'] = $re_cf['title'] ? $re_cf['title'] : '';
$info_show['statusList'] = $statusList;
$info_show['status2List'] = $status2List;
$info_show['c_time'] = date('Y-m-d H:i', $re['c_time']);
$info_show['en_time'] = $re['en_time'];
if (SUPER_ADMIN == $this->role) {
$info_show['mobile_sub'] = $re['mobile'];
} else {
$info_show['mobile_sub'] = $re['mobile'] ? substr_replace($re['mobile'], '*****', 0, 5) : '';
}
$resLogs = $this->mdOplogs->select(array('clue_id' => $id), 'c_time desc', 0, 0);
foreach ($resLogs as $key => $value) {
$setValue = array();
$setValue['uname'] = $value['uname'];
$setValue['log'] = $value['log'];
$setValue['type_name'] = $this->mdOplogs->typeAry()[$value['type']];
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$rec_url = $rec_text = '';
if ($value['type'] == 2) {//拨打电话
$rec_text = '未接通';
$row = $this->mdReceiverXz->get(array('id' => $value['log']));
if ($row['duration']) {
$rec_url = $row['rec_url'] ? build_qiniu_image_url($row['rec_url'], 0, 0, 'video') : '';
$rec_text = '录音文件未生成';
}
}
$setValue['rec_url'] = $rec_url;
$setValue['rec_text'] = $rec_text;
$logsList[] = $setValue;
}
$info_show['logsList'] = $logsList;
//意向信息
$jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : [];
//获取城市区域
$dataInfo['city_id'] = $re['city_id'];
$dataInfo['county_id'] = $re['county_id'];
$dataInfo['v_id'] = intval($jsondata['car']['version']['id']);
$dataInfo['cor_id'] = intval($jsondata['car']['color']['id']);
//获取已分配店铺
$cus = $this->customers_model->select(['rid' => $re['id']], '', '', '', 'biz_id');
$biz_arr = [];
if ($cus) {
$biz_ids = implode(array_column($cus, 'biz_id'), ',');
if ($biz_ids) {
$where_biz["id in ($biz_ids)"] = null;
$cus_biz = $this->biz_model->select($where_biz, '', '', '', 'biz_name');
$biz_arr = array_column($cus_biz, 'biz_name');
}
}
$info_show['cus_bizs'] = implode($biz_arr, ',');
//附近门店
if ($re['lat'] && $re['lng']) {
$info_show['near_bizs'] = $this->biz_model->nearby($re['lat'], $re['lng'], 1, 3, 'id,biz_name');
} else {
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
}
//获取分销用户
$cf_user = '';
if ($dataInfo['recommend_id']) {
$this->load->model('app/liche/app_liche_users_model');
$user = $this->app_liche_users_model->get(['id' => $dataInfo['recommend_id']], 'id,nickname,up_uid');
$user['up_uid'] && $up_user = $this->app_liche_users_model->get(['id' => $user['up_uid']], 'id,nickname'); //上一级分销用户
if ($up_user) {
$cf_user = "{$up_user['nickname']}(一级) => {$user['nickname']}(二级)";
} else {
$cf_user = $user['nickname'];
}
}
$info_show['cf_user'] = $cf_user;
$this->data['info'] = $dataInfo;
$this->data['info_show'] = $info_show;
$this->data['_title'] = '线索详情';
return $this->show_view('receiver/clues/edit', true);
}
/**
* Notes:二级分类
* Created on: 2021/9/15 14:16
* Created by: dengbw
* @return bool
*/
public function get_status2()
{
$params = $this->input->post();
$status = $params['status'];
$status2List = array();
if (strlen($status)) {
foreach ($this->clues_model->statusAry($status)['list'] as $key => $value) {
$status2List[] = array("id" => $key, "name" => $value);
}
}
$this->data = $status2List;
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* 新增
* @return bool
*/
function get_add()
{
$id = $this->input->get('id');
if ($id) {
$row = $this->clues_model->get(array('id' => $id));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '记录不存在');
}
$cf_id1 = '';
$cf_id2 = '';
if ($row['cf_id']) {
$row_cfrom = $this->clues_cfrom_model->get(array('id' => $row['cf_id']));
if ($row_cfrom['pid']) {
$cf_id1 = $row_cfrom['pid'];
$cf_id2 = $row['cf_id'];
} else {
$cf_id1 = $row['cf_id'];
}
}
$info = array(
'name' => $row['name'],
'mobile' => $row['mobile'],
'cf_id1' => $cf_id1,
'cf_id2' => $cf_id2,
);
$title = "编辑线索";
$action = "edit";
} else {
$info = array(
'name' => '',
'mobile' => '',
'cf_id1' => '',
'cf_id2' => '',
);
$title = "新增线索";
$action = "add";
}
$where = array('status' => 1, 'pid' => 0);
$select = 'id, title';
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', $where, '', 0, 0, $select);
$this->data['info'] = $info;
$this->data['cfromAry'] = $map_cfrom;
$this->data['action'] = $action;
$this->data['_title'] = $title;
return $this->show_view('receiver/clues/get');
}
//添加单条数据
public function add(){
public function add()
{
$info = $this->input->post('info');
if (!$info['name']) {
return $this->show_json(SYS_CODE_FAIL, '请填写姓名');
}
if (!mobile_valid($info['mobile'])) {
return $this->show_json(SYS_CODE_FAIL, '手机号码不准确');
}
if ($this->clues_model->get(['mobile' => $info['mobile']])) {
return $this->show_json(SYS_CODE_FAIL, '手机号已存在');
}
$cf_id = 0;
if ($info['cf_id2']) {
$cf_id = $info['cf_id2'];
} else if ($info['cf_id1']) {
$cf_id = $info['cf_id1'];
}
$add = array(
'name' => $info['name'],
'mobile' => $info['mobile'],
'cf_id' => $cf_id,
'admin_id' => $this->uid,
'c_time' => time(),
);
$ret = $this->clues_model->add($add);
if (!$ret) {
debug_log("[error]# add fail; " . $this->clues_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function add_log()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$params['log']) {
return $this->show_json(SYS_CODE_FAIL, '请输入内容!');
}
$addData = array(
'clue_id' => $params['id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($params['type']),
'log' => $params['log'],
'c_time' => time()
);
$id = $this->mdOplogs->add($addData);
if ($id) {
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
function add_excel()
{
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
$res = $this->upload();
if (!$res['code']) {
return $this->show_json(0, $res['message']);
}
$file = $res['path'];
if ($res['file_ext'] == '.xls') {
$reader = \PHPExcel_IOFactory::createReader('Excel5'); // 读取 excel 文档
} elseif ($res['file_ext'] == '.xlsx') {
$reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档
} else {
return $this->show_json(SYS_CODE_FAIL, '文件无法识别');
}
$PHPExcel = $reader->load($file); // 文档名称
$objWorksheet = $PHPExcel->getActiveSheet();
$rowCnt = $objWorksheet->getHighestRow(); //获取总行数
if ($rowCnt > 800) {
@unlink($file);
return $this->show_json(0, '数据大于800请拆分多个表格导入');
}
$data = array();
for ($_row = 2; $_row <= $rowCnt; $_row++) { //读取内容
$data[] = array(
'name' => $objWorksheet->getCell('A' . $_row)->getValue(),
'mobile' => $objWorksheet->getCell('B' . $_row)->getValue(),
'cfrom' => $objWorksheet->getCell('C' . $_row)->getValue(),
);
}
$done = $this->add_batch($data);
@unlink($file);
$this->data['load_num'] = count($data);
$this->data['done'] = $done;
return $this->show_json(SYS_CODE_SUCCESS, "成功导入{$done}");
}
//编辑单条数据
public function edit(){
public function edit()
{
$info = $this->input->post('info');
if (!$info) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$re = $this->clues_model->get(array('id' => $info['id']));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
}
$msg = '修改成功';
$code = SYS_CODE_SUCCESS;
if ($info['editType'] == 1) {
$statusAry = $this->clues_model->statusAry();
if ($info['status'] == $re['status'] && $info['status2'] == $re['status2']) {
return $this->show_json(SYS_CODE_FAIL, '状态未修改!');
}
$status_name = $statusAry[$re['status']]['name'];
$status_name_up = $statusAry[$info['status']]['name'];
if ($info['status2']) {
$status_name .= '-' . $statusAry[$re['status']]['list'][$re['status2']];
$status_name_up .= '-' . $statusAry[$info['status']]['list'][$info['status2']];
}
$log = '更新状态(' . $status_name . ')为(' . $status_name_up . ')';
$ret = $this->clues_model->update(array('status' => $info['status'], 'status2' => $info['status2']), array('id' => $info['id']));
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改状态失败';
} else {
$msg = '修改状态成功';
$this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => $log));
}
} else if ($info['editType'] == 2) {
if ($info['name'] == $re['name']) {
return $this->show_json(SYS_CODE_FAIL, '客户姓名未修改!');
}
$log = '更新客户姓名(' . $re['name'] . ')为(' . $info['name'] . ')';
$ret = $this->clues_model->update(array('name' => $info['name']), array('id' => $info['id']));
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改用户信息失败';
} else {
$msg = '修改用户信息成功';
$this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => $log));
}
} else if ($info['editType'] == 3) {
$up_data = [
'city_id' => $info['city_id'],
'county_id' => $info['county_id']
];
$ret = $this->clues_model->update($up_data, array('id' => $info['id']));
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改意向信息失败';
} else {
$msg = '修改意向信息成功';
$this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => '修改意向信息'));
}
}
return $this->show_json($code, $msg);
}
/**
* Notes:增加日志
* Created on: 2021/7/23 10:48
* Created by: dengbw
* @param array $ary
* @return mixed
*/
private function addLog($ary = array())
{
$id = 0;
if ($ary['log']) {
$addData = array(
'clue_id' => $ary['clue_id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($ary['type']),
'log' => $ary['log'],
'c_time' => time()
);
$id = $this->mdOplogs->add($addData);
}
return $id;
}
//删除单条数据
public function del(){
public function del()
{
}
//批量操作(默认修改状态)
public function batch(){
public function batch()
{
}
//导出数据列表
public function export(){
public function export()
{
}
@@ -99,24 +520,33 @@ class Clues extends HD_Controller{
public function get_adviser()
{
$ids = $this->input->get('ids');
$where = [
'status>' => -1,
'group_id' => 1
];
$adminList = $this->app_licheb_users_model->select($where,'','','','id,uname,mobile');
$this->data['adminList'] = $adminList;
if ($this->input->method() == 'post') {
$city_id = $this->input->post('city_id');
$county_id = $this->input->post('county_id');
$where = [
'status' => 1,
];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
$this->data['bizList'] = $bizList;
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
$this->data['ids'] = $ids;
return $this->show_view('receiver/clues/get_adviser');
}
public function edit_adviser()
{
$admin_id = $this->input->post('admin_id');
$this->load->library('receiver/clues_entity');
$this->load->library('receiver/customers_entity');
$biz_id = $this->input->post('biz_id');
$ids = $this->input->post('ids');
$ids_arr = explode(',',$ids);
$user = $this->app_licheb_users_model->get(['id'=>$admin_id]);
if (!$user) {
return $this->show_json(SYS_CODE_FAIL, '请选择分配销售');
$ids_arr = explode(',', $ids);
$biz = $this->biz_model->get(['id' => $biz_id]);
if (!$biz) {
return $this->show_json(SYS_CODE_FAIL, '请选择分配门店');
}
if (!is_array($ids_arr)) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
@@ -124,40 +554,274 @@ class Clues extends HD_Controller{
$where = [
"id in ($ids)" => null
];
$clues_rows = $this->clues_model->map('id','',$where);
foreach($ids_arr as $val){
$clues_rows = $this->clues_model->map('id', '', $where);
foreach ($ids_arr as $val) {
$clues_row = $clues_rows[$val][0];
//判断是否已分配
$cus_row = $this->customers_model->get(['rid'=>$val,'status != 3'=>null]);
if($clues_row && !$cus_row){
$jsondata = json_decode($clues_row['jsondata'],true);
$cus_row = $this->customers_model->get(['rid' => $val, 'status>=' => 0]);
if ($clues_row && !$cus_row) {
$jsondata = json_decode($clues_row['jsondata'], true);
$add_data = [
'rid' => $val,
'name' => $clues_row['name'],
'mobile' => $clues_row['mobile'],
'biz_id' => $biz_id,
'city_id' => $biz['city_id'],
'county_id' => $biz['county_id'],
'brand_id' => $clues_row['brand_id'],
's_id' => $clues_row['s_id'],
'if_driver' => $clues_row['if_driver'],
'admin_id' => $admin_id,
'cf_title' => '平台分配',
'of_id' => 3,
'of2_id' => 37,
'cf_id' => $clues_row['cf_id'],
'p_time' => date('Y-m-d H:i:s'),
'c_time' => time()
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time'])
];
if($jsondata['car']){
if ($jsondata['car']) {
isset($jsondata['car']['version']) && $add_data['v_id'] = $jsondata['car']['version']['id'];
$add_data['car_json'] = json_encode($jsondata['car'],JSON_UNESCAPED_UNICODE);
$add_data['car_json'] = json_encode($jsondata['car'], JSON_UNESCAPED_UNICODE);
unset($jsondata['car']);
}
$jsondata && $add_data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$jsondata && $add_data['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
$customers_id = $this->customers_model->add($add_data);
if($customers_id){
$this->clues_model->update(['admin_id'=>$admin_id],['id'=>$val]);
$this->load->library('receiver/clues_entity');
$this->clues_entity->add_log($val,$this->uid,$this->username,"分配给【{$user['uname']}】用户");
if ($customers_id) {
$this->clues_model->update(['status' => 1], ['id' => $val]);
//同步线索日志到客户日志
$this->customers_entity->syn_clues($customers_id, $val);
$this->customers_entity->add_log($customers_id, $this->uid, $this->username, "平台分配", 0, 'admin');
$this->clues_entity->add_log($val, $this->uid, $this->username, "分配给【{$biz['biz_name']}】商家");
}
}
}
return $this->show_json(SYS_CODE_SUCCESS, '分配成功!');
}
public function lists_call()
{
$this->load->model('sys/sys_admin_model', 'mdAdmin');
$cache = &load_cache('redis');
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
$params = $this->input->get();
$username = $params['username'];
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where['status'] = 1;
if (!empty($username)) $where["username like '%$username%'"] = null;
if (!empty($params['mobile'])) $where['mobile'] = $params['mobile'];
$count = $this->mdAdmin->count($where);
if ($count) {
$res = $this->mdAdmin->select($where, 'id desc', $params['page'], $params['size'], 'id,username,mobile');
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['username'] = $value['username'];
$setValue['mobile'] = $value['mobile'];
$phone = $xz_admin_phone['admins'][$value['id']];
if ($phone) {
$phone_btn = '<a class="am-btn am-btn-danger am-btn-xs" data-action="/receiver/clues/edit_call" data-ajax="post"
data-params-type="1" data-params-id="' . $value['id'] . '" >取消分配</a>';
} else {
$phone = '未分配';
$phone_btn = '<a class="am-btn am-btn-primary am-btn-xs" data-action="/receiver/clues/edit_call" data-ajax="post"
data-params-type="0" data-params-id="' . $value['id'] . '" >分配号码</a>';
}
$setValue['phone'] = $phone;
$setValue['phone_btn'] = $phone_btn;
$lists[] = $setValue;
}
}
$this->data['params'] = $params;
$this->data['_title'] = '虚似号分配';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
return $this->show_view('receiver/clues/lists_call', true);
}
public function edit_call()
{
$id = intval($this->input->post('id'));
$type = $this->input->post('type');
if ($type != 3 && !$id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$cache = &load_cache('redis');
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
$this->config->load('xcall', TRUE);
$mobiles = $this->config->item('mobile_list', 'xcall');
$mobiles && shuffle($mobiles);
if ($type == 0) {//分配手机
if (!$mobiles) {
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
}
$number = '';
foreach ($mobiles as $key => $value) {
if (!$xz_admin_phone['numbers'][$value]) {
$number = $value;
break;
}
}
if ($number) {
$xz_admin_phone['admins'][$id] = $number;
$xz_admin_phone['numbers'][$number] = $id;
$cache->save($this->cacheKeyPhone, $xz_admin_phone);
return $this->show_json(SYS_CODE_SUCCESS, '分配号码成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '号码已全部分配完了');
}
} else if ($type == 1) {//取消分配
$number = $xz_admin_phone['admins'][$id];
unset($xz_admin_phone['admins'][$id]);
unset($xz_admin_phone['numbers'][$number]);
$cache->save($this->cacheKeyPhone, $xz_admin_phone);
return $this->show_json(SYS_CODE_SUCCESS, '取消分配成功');
} else if ($type == 3) {//全部重新分配
if (!$mobiles) {
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
}
if (!$xz_admin_phone['admins']) {
return $this->show_json(SYS_CODE_FAIL, '未分配号码,不能重置');
}
$xz_admin_phone_new = array();
$i = 0;
foreach ($xz_admin_phone['admins'] as $key => $value) {
$number = $mobiles[$i];
$id = $key;
if ($number) {
$xz_admin_phone_new['admins'][$id] = $number;
$xz_admin_phone_new['numbers'][$number] = $id;
}
$i++;
}
$cache->save($this->cacheKeyPhone, $xz_admin_phone_new);
return $this->show_json(SYS_CODE_SUCCESS, '重置已分配成功');
}
}
/**
* 返回map select数据
* @return bool
*/
function json_map_cfrom()
{
$pid = $this->input->post('pid');
$status = $this->input->post('status');
$where = array();
if (strlen($pid) > 0) {
$where['pid'] = $pid;
}
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$where["status>-1"] = null;
}
$total = $this->clues_cfrom_model->count($where);
$map = array();
if ($total) {
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->clues_cfrom_model->select($where, $orderby, 0, 0, $select);
foreach ($rows as $v) {
$map[$v['id']] = $v['title'];
}
}
$this->data = $map;
return $this->show_json(SYS_CODE_SUCCESS);
}
private function upload()
{
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
$config['allowed_types'] = 'xls|xlsx';
$config['max_size'] = 5120;
$config['file_name'] = 'receiver_clues' . time() . rand(1, 99999);
$this->load->library('upload', $config);
if (!$this->upload->do_upload('file')) {
return array('code' => SYS_CODE_FAIL, 'message' => $this->upload->display_errors('', ''));
} else {
$data = $this->upload->data();
return array('code' => SYS_CODE_SUCCESS, 'path' => $data['full_path'], 'file_ext' => $data['file_ext']);
}
}
/**
* 批量新增
* @param $lists
* @return int
*/
private function add_batch($lists)
{
$done = 0;
$adds = array();
$where = array('status' => 1);
$select = 'id, title';
$map_cfrom = $this->clues_cfrom_model->map('title', 'id', $where, '', 0, 0, $select);
$fails = array();
foreach ($lists as $k => $v) {
if (!$v['name']) {
$fails[] = array('data' => $v, 'msg' => 'name is null');
continue;
}
if (!mobile_valid($v['mobile'])) {
$fails[] = array('data' => $v, 'msg' => 'mobile valid fail');
continue;
}
if ($this->clues_model->get(['mobile' => $v['mobile']])) {
$fails[] = array('data' => $v, 'msg' => '手机号已存在');
continue;
}
$cf_id = $map_cfrom[$v['cfrom']];
$adds[] = array(
'name' => $v['name'],
'mobile' => $v['mobile'],
'cf_id' => $cf_id ? $cf_id : 0,
'c_time' => time(),
);
$done++;
}
$fails && debug_log('[warning]# fails=' . json_encode($fails), __FUNCTION__, $this->log_dir);
if ($adds) {
$ret = $this->clues_model->add_batch($adds);
if (!$ret) {
debug_log("[error] add_batch fail; " . $this->clues_model->db->last_query(), __FUNCTION__, $this->log_dir);
$done = 0;
}
}
return $done;
}
//获取线索来源
public function get_cfroms()
{
$id = $this->input->get('id');
$where = [
'status' => 1,
'pid' => 0
];
$id && $where['pid'] = $id;
$rows = $this->clues_cfrom_model->select($where, 'id desc', '', '', 'id,title');
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function get_bizInfo()
{
$id = $this->input->get('id');
$info = $this->biz_model->get(['id' => $id], 'city_id,county_id,address');
$city = $this->area_model->get(['county_id' => $info['county_id']]);
$bizinfo['city_name'] = $city['city_name'];
$bizinfo['county_name'] = $city['county_name'];
$bizinfo['address'] = $info['address'];
$this->data['bizinfo'] = $bizinfo;
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+604
View File
@@ -0,0 +1,604 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/7/26
* Time: 11:20
*/
class Customer extends HD_Controller
{
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
private $searchTimeAry = array('c_time' => '创建时间', 'p_time' => '分配时间', 'cont_time' => '最后联系时间', 'u_time' => '最后操作时间'
, 'dt_time' => '首次到店时间', 'order_time' => '下单时间');
protected $log_dir;
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('receiver/receiver_customer_oplogs_model', 'customer_oplogs_model');
$this->load->model('receiver/receiver_customer_tag_model', 'mdCustomerTag');
$this->load->model('receiver/receiver_customer_tagdata_model', 'mdCustomerTagdata');
$this->load->model('receiver/receiver_clues_model', 'clues_model');
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
$this->load->model('receiver/receiver_xz_model');
$this->load->model('app/licheb/app_licheb_users_model');
$this->load->model("biz/biz_model");
$this->load->model('auto/auto_brand_model');
$this->log_dir = 'receiver_' . get_class($this);
}
public function index()
{
return $this->lists();
}
public function lists()
{
$status_arr = $this->customers_model->get_status();
unset($status_arr['-1']);
$params = $this->input->get();
!$params['biz_id'] && $params['biz_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['level'] && $params['level'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!$params['wxqy'] && $params['wxqy'] = '';
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$where = array('status>=0' => null);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["biz_id in ($biz_ids)"] = null;
}
if (false == strpos($_SERVER['HTTP_HOST'], 'dev')) {//dev时不限制
$where['biz_id<>'] = 1;
$where['brand_id<>'] = 3;
}
if ($params['title']) {
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
if ($params['level']) {
$where['level'] = $params['level'];
}
if ($params['of_id']) {
$where['of_id'] = $params['of_id'];
}
if ($params['of2_id']) {
$where['of2_id'] = $params['of2_id'];
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['wxqy']) && $where["wxqy"] = $params['wxqy'];
if ($params['qdjl_id']) {
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
//销售员筛选
if ($params['admin_id']) {
$where['admin_id'] = $params['admin_id'];
} else {
$where_lcb = array();
$str_ids = '';
if ($params['biz_id_admin']) {//指定店铺所有销售员
$where_lcb['biz_id'] = $params['biz_id_admin'];
$str_ids = $params['biz_id_admin'];
} else {
//指定城市的所有销售员
$where_biz = array();
if ($params['county_id_admin']) {
$where_biz['county_id'] = $params['county_id_admin'];
} else if ($params['city_id_admin']) {
$where_biz['city_id'] = $params['city_id_admin'];
}
if ($where_biz) {
$where_biz['status>-1'] = null;
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($rows_biz) {
$str_ids = implode(',', array_column($rows_biz, 'id'));
$where_lcb["biz_id in({$str_ids})"] = null;
} else {
$where_lcb['biz_id'] = -1;
}
}
}
//获取目标销售员列表
if ($where_lcb) {
$params['city_id_admin'] && $where['city_id'] = $params['city_id_admin'];
$params['county_id_admin'] && $where['county_id'] = $params['county_id_admin'];
$params['biz_id_admin'] && $where['biz_id'] = $params['biz_id_admin'];
$where_lcb['status>-1'] = null;
$rows_lcb = $this->app_licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
if ($rows_lcb) {
$str_ids = implode(',', array_column($rows_lcb, 'id'));
$str_ids = $str_ids . ',0';
$where["admin_id in({$str_ids})"] = null;
} else {
if (!$str_ids) {
$where['admin_id'] = -1;
}
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
if ($params['p_time']) {
$p_time = explode(' ~ ', $params['p_time']);
$p_time[0] && $where["p_time >="] = $p_time[0] . ' 00:00:00';
$p_time[1] && $where["p_time <="] = $p_time[1] . ' 23:59:59';
}
if ($params['cont_time']) {
$cont_time = explode(' ~ ', $params['cont_time']);
$cont_time[0] && $where["cont_time >="] = $cont_time[0] . ' 00:00:00';
$cont_time[1] && $where["cont_time <="] = $cont_time[1] . ' 23:59:59';
}
if ($params['u_time']) {
$u_time = explode(' ~ ', $params['u_time']);
$u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00';
$u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59';
}
if ($params['dt_time']) {
$dt_time = explode(' ~ ', $params['dt_time']);
$dt_time[0] && $where["dt_time >="] = $dt_time[0] . ' 00:00:00';
$dt_time[1] && $where["dt_time <="] = $dt_time[1] . ' 23:59:59';
}
if ($params['order_time']) {
$order_time = explode(' ~ ', $params['order_time']);
$order_time[0] && $where["order_time >="] = $order_time[0] . ' 00:00:00';
$order_time[1] && $where["order_time <="] = $order_time[1] . ' 23:59:59';
}
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id'] == 24) {
$where['cf_id'] = 24;
$params['cfrom_id2'] && $where['t_id'] = $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
} else {
$cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
}
}
}
$count = $this->customers_model->count($where);
$lists = [];
$offlineSources = $this->customers_model->offlineSources();
$wxqyAry = $this->customers_model->wxqyAry();
if ($count) {
$fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxqy';
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
//获取销售员
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
$admin_id_arr && $admin_rows = $this->app_licheb_users_model->get_map_by_ids($admin_id_arr, 'id,uname');
//获取门店
$biz_id_arr = array_unique(array_column($rows, 'biz_id'));
$biz_id_arr && $biz_rows = $this->biz_model->get_map_by_ids($biz_id_arr, 'id,biz_name');
foreach ($rows as $key => $val) {
if (SUPER_ADMIN == $this->role || $this->role == 35) {
$mobile_sub = $val['mobile'];
} else {
$mobile_sub = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
}
$of_title = '';
if ($val['of_id']) {
$of_ary = $offlineSources[$val['of_id']];
$of_title = $of_ary['name'];
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
}
$lists[] = array(
'id' => $val['id'],
'name' => $val['name'],
'mobile' => $val['mobile'],
'mobile_sub' => $mobile_sub,
'level' => $val['level'],
'of_title' => $of_title,
'of2_id' => $val['of2_id'],
'status_name' => $status_arr[$val['status']],
'wxqy_name' => $wxqyAry[$val['wxqy']],
'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '',
'biz_name' => isset($biz_rows[$val['biz_id']]) ? $biz_rows[$val['biz_id']][0]['biz_name'] : '',
'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '',
);
}
}
//渠道经理
$qdjl_lists = $this->app_licheb_users_model->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name');
$show_info['levelAry'] = $this->customers_model->get_sdata('level');
$show_info['offlineSourcesAry'] = $offlineSources;
$show_info['wxqyAry'] = $wxqyAry;
$this->data['show_info'] = $show_info;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['searchTpAry'] = $this->searchTpAry;
$this->data['searchTimeAry'] = $this->searchTimeAry;
$this->data['params'] = $params;
$this->data['status_arr'] = $status_arr;
$this->data['qdjl_lists'] = $qdjl_lists;
$this->data['_title'] = '客户列表';
return $this->show_view('receiver/customer/lists', true);
}
public function get()
{
$id = $this->input->get('id');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$row = $this->customers_model->get(array('id' => $id));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
$if_driver = 1 == $row['if_driver'] ? '是' : '否';
$is_top = 1 == $row['is_top'] ? '是' : '否';
//$car_json = json_decode($row['car_json'], true);
//$version = $this->auto_attr_model->get(['id' => $car_json['v_id']], 'title');
//$color = $this->auto_attr_model->get(['id' => $car_json['c_id']], 'title');
//$side = $version ? $version['title'] : '';
//$color = $color ? $color['title'] : '';
//$row_brand = $this->auto_brand_model->get(array('id' => $row['brand_id']), 'name');
//$row_seriy = $this->auto_series_model->get(array('id' => $row['s_id']), 'name');
$row_biz = $this->biz_model->get(array('id' => $row['biz_id']));
//获取销售员
$row_admin = $this->app_licheb_users_model->get(array('id' => $row['admin_id']), 'id,uname');
//操作日志
$rows_log = $this->customer_oplogs_model->select(array('customer_id' => $id), 'id desc', 0, 0);
//用户信息
if (SUPER_ADMIN == $this->role || 35 == $this->role) {
$mobile_sub = $row['mobile'];
} else {
$mobile_sub = $row['mobile'] ? substr_replace($row['mobile'], '*****', 0, 5) : '';
}
//获取分销用户
$cf_user = '';
$clues = $this->clues_model->get(['id' => $row['rid']], 'recommend_id');
if ($clues['recommend_id']) {
$this->load->model('app/liche/app_liche_users_model');
$user = $this->app_liche_users_model->get(['id' => $clues['recommend_id']], 'id,nickname,up_uid');
$user['up_uid'] && $up_user = $this->app_liche_users_model->get(['id' => $user['up_uid']], 'id,nickname'); //上一级分销用户
if ($up_user) {
$cf_user = "{$up_user['nickname']}(一级) => {$user['nickname']}(二级)";
} else {
$cf_user = $user['nickname'];
}
}
$of_title = '';
if ($row['of_id']) {
$of_ary = $this->customers_model->offlineSources()[$row['of_id']];
$of_title = $of_ary['name'];
$row['of2_id'] && $of_title .= '-' . $of_ary['list'][$row['of2_id']];
}
$info = array(
'id' => $row['id'],
'name' => $row['name'],
'mobile' => $mobile_sub,
'of_title' => $of_title,
'wxqy_name' => $this->customers_model->wxqyAry($row['wxqy']),
'cf_user' => $cf_user,
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
'status' => $row['status'],
'tag' => $this->get_tag($row['id']),
);
//到店信息
$toshop = array(
array(
array('title' => '门店', 'value' => $row_biz['biz_name']),
array('title' => '试驾', 'value' => $if_driver),
array('title' => '到店次数', 'value' => $row['a_num']),
array('title' => '试驾次数', 'value' => $row['t_num']),
),
// array(
// array('title' => '品牌', 'value' => $row_brand['name']),
// array('title' => '车系', 'value' => $row_seriy['name']),
// array('title' => '车型', 'value' => $side),
// array('title' => '颜色', 'value' => $color),
// ),
array(
array('title' => '分配时间', 'value' => $row['p_time'] != '0000-00-00 00:00:00' ? $row['p_time'] : ''),
array('title' => '最后联系', 'value' => $row['cont_time'] != '0000-00-00 00:00:00' ? $row['cont_time'] : ''),
array('title' => '首次到店', 'value' => $row['dt_time'] != '0000-00-00 00:00:00' ? $row['dt_time'] : ''),
array('title' => '下单时间', 'value' => $row['order_time'] != '0000-00-00 00:00:00' ? $row['order_time'] : ''),
),
array(
array('title' => '预计购买时间', 'value' => "{$row['buy_time']} 天内"),
array('title' => '重点关注', 'value' => $is_top),
array('title' => '销售员', 'value' => $row_admin['uname']),
),
);
//操作日志
$logs = array();
foreach ($rows_log as $key => $value) {
$rec_text = $rec_url = '';
if ($value['type'] == 2) {
$rec_row = $this->receiver_xz_model->get(['id' => $value['log']], 'rec_url,duration');
if ($rec_row['duration']) {
$rec_row['rec_url'] && $rec_url = $rec_row['rec_url'];
!$rec_row['rec_url'] && $rec_text = '录音暂未生成';
} else {
$rec_text = '未接通';
}
}
$imgs = [];
if ($value['imgs']) {
$json_imgs = json_decode($value['imgs'], true);
foreach ($json_imgs as $key1 => $value1) {
$imgs[] = build_qiniu_image_url($value1);
}
}
$logs[] = array(
'uname' => $value['uname'],
'log' => $value['log'],
'imgs' => $imgs,
'rec_url' => $rec_url,
'rec_text' => $rec_text,
'type_name' => $this->customer_oplogs_model->typeAry()[$value['type']],
'c_time' => date('Y-m-d H:i', $value['c_time'])
);
}
//状态值,-1不显示
$statusAry = $this->customers_model->get_status();
unset($statusAry['-1']);
$this->data['statusAry'] = $statusAry;
$this->data['info'] = $info;
$this->data['toshop'] = $toshop;
$this->data['logs'] = $logs;
$this->data['_title'] = '客户详情';
return $this->show_view('receiver/customer/get', true);
}
public function add()
{
// TODO: Implement add() method.
}
/**
* 新增日志
* @return bool
*/
function add_log()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$params['log']) {
return $this->show_json(SYS_CODE_FAIL, '请输入内容!');
}
$addData = array(
'customer_id' => $params['id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($params['type']),
'log' => $params['log'],
'c_time' => time()
);
$id = $this->customer_oplogs_model->add($addData);
if ($id) {
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
} else {
debug_log("[error]" . $this->customer_oplogs_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
/**
* 编辑
* @return bool
*/
public function edit()
{
$info = $this->input->post('info');
if (!$info) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$row = $this->customers_model->get(array('id' => $info['id']));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '客户信息不存在!');
}
$msg = '修改成功';
$code = SYS_CODE_SUCCESS;
if ($info['editType'] == 1) {
//更新状态
$statuAry = $this->customers_model->get_status();
$status_name = $statuAry[$row['status']];
$status_name_up = $statuAry[$info['status']];
$log = '更新状态(' . $status_name . ')为(' . $status_name_up . ')';
$up_data['status'] = $info['status'];
if ($info['status'] == 1 && $row['dt_time'] == '0000-00-00 00:00:00') {//修改首次到店时间
$up_data['dt_time'] = date('Y-m-d H:i:s');
}
$ret = $this->customers_model->update($up_data, array('id' => $info['id']));
if (!$ret) {
debug_log("[error]" . $this->customers_model->db->last_query(), __FUNCTION__, $this->log_dir);
$code = SYS_CODE_FAIL;
$msg = '修改状态失败';
} else {
$msg = '修改状态成功';
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => $log));
}
} else if ($info['editType'] == 2) {
//更新客户信息
if ($info['name'] == $row['name']) {
return $this->show_json(SYS_CODE_FAIL, '客户姓名未修改!');
}
$log = '更新客户姓名(' . $row['name'] . ')为(' . $info['name'] . ')';
$ret = $this->customers_model->update(array('name' => $info['name']), array('id' => $info['id']));
if (!$ret) {
debug_log("[error]" . $this->customers_model->db->last_query(), __FUNCTION__, $this->log_dir);
$code = SYS_CODE_FAIL;
$msg = '修改用户信息失败';
} else {
$msg = '修改用户信息成功';
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => $log));
}
} else if ($info['editType'] == 3) {
$id = $info['id'];
//客户标签
if (!$info['tag']) {
return $this->show_json(SYS_CODE_FAIL, '客户画像不存在!');
}
$add_tag = [];
//查找已加入标签
$res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
foreach ($info['tag'] as $key => $val) {
foreach ($val['list'] as $key2 => $val2) {
if ($val['type'] == 'checkbox') {
if ($val2['checked'] == 'true') {
if (!$tag_data || !in_array($val2['id'], $tag_data)) {//未加标签,新增
$add_tag[] = ['c_id' => $id, 't_id' => $val2['id'], 'c_time' => time()];
}
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {//删除标签
$this->mdCustomerTagdata->delete(['c_id' => $id, 't_id' => $val2['id']]);
}
}
} else {
if ($val['value'] == $val2['id']) {
if (!$tag_data || !in_array($val2['id'], $tag_data)) {//未加标签,新增
$add_tag[] = ['c_id' => $id, 't_id' => $val2['id'], 'c_time' => time()];
}
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {//删除标签
$this->mdCustomerTagdata->delete(['c_id' => $id, 't_id' => $val2['id']]);
}
}
}
}
}
if ($add_tag && count($add_tag)) {
$this->mdCustomerTagdata->add_batch($add_tag);
}
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => '修改用户画像'));
}
return $this->show_json($code, $msg);
}
public function del()
{
$id = $this->input->post('id');
$row = $this->customers_model->get(['id' => $id, 'cf_title' => '平台分配']);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
$res = $this->customers_model->update(['status' => -1], ['id' => $id]);
if ($res) {
return $this->show_json(SYS_CODE_SUCCESS, '删除成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '删除失败');
}
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
// TODO: Implement export() method.
}
//改派
public function edit_adviser()
{
$id = $this->input->get_post('id');
$biz_id = $this->input->post('biz_id');
$row = $this->customers_model->get(['id' => $id, 'cf_title' => '平台分配']);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
}
if ($this->input->post()) {
if (!$biz_id) return $this->show_json(SYS_CODE_FAIL, '请选择门店');
if ($biz_id == $row['biz_id']) return $this->show_json(SYS_CODE_FAIL, '请选择不同门店');
$res = $this->customers_model->update(['biz_id' => $biz_id, 'admin_id' => 0], ['id' => $id]);
if ($res) {
$log = "改派订单";
$this->addLog(['customer_id' => $row['id'], 'log' => $log, 'type' => 0]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
$this->data['id'] = $id;
return $this->show_view('receiver/customer/get_adviser');
}
/**
* Notes:增加日志
* Created on: 2021/7/23 10:48
* Created by: dengbw
* @param array $ary
* @return mixed
*/
private function addLog($ary = array())
{
$id = 0;
if ($ary['log']) {
$addData = array(
'customer_id' => $ary['customer_id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($ary['type']),
'log' => $ary['log'],
'cf_platform' => 'admin',
'c_time' => time()
);
$id = $this->customer_oplogs_model->add($addData);
}
return $id;
}
private function get_tag($id)
{
$show = $res_td = [];
$res = $this->mdCustomerTag->select(['status' => 1, 'pid' => 0, 'show<>' => 1], 'sort desc,id desc', 0, 0, 'id,name,type');
if ($res) {
$id && $res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
foreach ($res as $key => $val) {
$list = [];
$value = '';
$res2 = $this->mdCustomerTag->select(['status' => 1, 'pid' => $val['id']], 'sort desc,id desc', 0, 0, 'id,name');
foreach ($res2 as $key2 => $val2) {
//检查是否选中标签
$setValue = ['id' => $val2['id'], 'name' => $val2['name']];
if ($val['type'] == 'checkbox') {
$setValue['checked'] = $tag_data && in_array($val2['id'], $tag_data) ? true : false;
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {
$value = $val2['id'];
}
}
$list[] = $setValue;
}
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'list' => $list];
}
}
return $show;
}
}
+973
View File
@@ -0,0 +1,973 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Orders extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
$this->load->model('receiver/order/receiver_order_signs_model', 'order_signs_model');
$this->load->model('receiver/order/receiver_order_loans_model', 'order_loans_model');
$this->load->model('receiver/order/receiver_order_ckcars_model', 'order_ckcars_model');
$this->load->model('receiver/order/receiver_order_bills_model', 'order_bills_model');
$this->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
$this->load->model('receiver/order/receiver_order_contracts_model', 'order_contracts_model');
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_finance_model');
$this->load->model('sys/sys_finance_model');
$this->load->model('sys/sys_company_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->library('receiver/orders_entity');
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$statusAry = $this->orders_model->statusAry();
$status_arr = array();
foreach ($statusAry as $key => $value) {
if (!$value['show']) {
continue;
}
$cate = $where = array();
$t2 = 'lc_receiver_orders';
if ($key == 7) {
$where_c = ["$t2.status<>" => -1];
} else {
$where_c = ["$t2.status not in(-1,7)" => null];
}
$where_c["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
$where_c["{$t2}.biz_id<>1"] = null;//biz_id=1不显示
if ($key == 6 || $key == 7) {
$count1 = $this->orders_model->count(array("status" => $key, "biz_id<>" => 1, "brand_id<>" => 3));
} else {
if ($key == 0) {
$t1 = 'lc_receiver_order_signs';
$order_model = $this->order_signs_model;
} else if ($key == 1) {
$t1 = 'lc_receiver_order_loans';
$order_model = $this->order_loans_model;
} else if ($key == 2) {
$t1 = 'lc_receiver_order_ckcars';
$order_model = $this->order_ckcars_model;
} else if ($key == 3) {
$t1 = 'lc_receiver_order_bills';
$order_model = $this->order_bills_model;
$where_c["$t1.status>"] = 0;
} else if ($key == 4) {
$t1 = 'lc_receiver_order_agents';
$order_model = $this->order_agents_model;
} else if ($key == 5) {
$t1 = 'lc_receiver_order_deliverys';
$order_model = $this->order_deliverys_model;
} else {
$t1 = 'lc_receiver_order_signs';
$order_model = $this->order_signs_model;
}
$count1 = $order_model->count_order($where_c, $t2);
if ($value['list']) {
foreach ($value['list'] as $key2 => $value2) {
$where_c["$t1.status"] = $key2;
$count2 = $order_model->count_order($where_c, $t2);
$cate[] = array("id" => $key2, "name" => $value2, "count" => $count2);
}
}
}
$status_arr[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
$params['count_all'] = $this->orders_model->count(array("status>=" => 0, "biz_id<>" => 1, "brand_id<>" => 3));//全部
$params['list_type'] = 'all';
$result = $this->orderslist->lists($params['status_pid'], $params);
$this->data = $result;
$this->data['status_arr'] = $status_arr;
return $this->show_view($result['view'], true);
}
public function get()
{
$status_arr = $this->orders_model->statusAry();
$id = $this->input->get('id');
$row = $this->orders_model->get(['id' => $id]);
//$sign = $this->order_signs_model->get(['o_id' => $row['id']], 'status');
$customers = $this->customers_model->get(['id' => $row['rid']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
if ($customers['of_id']) {//客户来源
$of_ary = $this->customers_model->offlineSources($customers['of_id']);
$of_title = $of_ary['name'];
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
$row['of_title'] = $of_title;
}
$sub_status_cn = $this->orderslist->sub_status_cn($row['id'],$row['status']);
$sub_status_cn && $sub_status_cn = "-".$sub_status_cn;
$money_json = json_decode($row['money_json'], true);
$deposit = $row['deposit'];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
$row['price_discount'] = $money_json['price_discount'];
$sale_price = $money_json['price_discount'] ? $row['price'] - $money_json['price_discount'] : $row['price'];
$row['sale_price'] = number_format($sale_price, 2);
$row['info_json'] = json_decode($row['info_json'], true);
$row['status'] = intval($row['status']);
$row['price'] = number_format($row['price'], 2);
$row['deposit'] = number_format($deposit, 2);
$row['c_time'] = date('Y-m-d', $row['c_time']);
$row['sign_status_name'] = $status_arr[$row['status']]['name'].$sub_status_cn;
$row['payway'] = intval($row['payway']);
$row['item_id'] = intval($row['item_id']);
$row['cardid'] = $row['info_json']['cardid'] ? $row['info_json']['cardid'] : $row['info_json']['c_cardid'];
$row['address'] = $row['info_json']['c_address'] ? $row['info_json']['c_address'] : '';
$row['entrust_name'] = $row['info_json']['entrust_name'] ? $row['info_json']['entrust_name'] : '';
$row['entrust_mobile'] = $row['info_json']['entrust_mobile'] ? $row['info_json']['entrust_mobile'] : '';
$row['entrust_idcard'] = $row['info_json']['entrust_idcard'] ? $row['info_json']['entrust_idcard'] : '';
$row['credit'] = $row['info_json']['c_credit'] ? $row['info_json']['c_credit'] : '';
$row['note'] = $jsondata['note'] ? $jsondata['note'] : '';
//获取车信息
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name');
$serie = $this->auto_series_model->get(['id' => $row['s_id']], 'name');
$row['brand_name'] = $brand['name'];
$row['s_name'] = $serie['name'];
$attr_arr = [$row['v_id'], $row['cor_id'], $row['incor_id']];
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
$row['v_name'] = isset($attr[$row['v_id']]) ? $attr[$row['v_id']][0]['title'] : '';
$row['cor_name'] = isset($attr[$row['cor_id']]) ? $attr[$row['cor_id']][0]['title'] : '';
$row['incor_name'] = isset($attr[$row['incor_id']]) ? $attr[$row['incor_id']][0]['title'] : '';
//获取选择车辆vin
if ($row['item_id']) {
$this->load->model('items/items_model', 'mdItems');
$row_goods = $this->mdItems->get(array('id' => $row['item_id']));
$row['vin'] = $row_goods['vin'];
}
$row['delry_time'] = $row['delry_time'] != '0000-00-00 00:00:00'
? str_replace(" 00:00:00", "", $row['delry_time']) : '';
//获取车辆服务费
$srv_info = $this->orders_entity->order_srv_money($row['id'], 1);
$srv_info['total'] = number_format($srv_info['total'], 2);
$srv_detail = "";
if ($srv_info['list']) {
foreach ($srv_info['list'] as $key => $val) {
$d = $srv_detail ? ',' : '';
$srv_detail .= $d . $val['title'] . ":" . number_format($val['money'], 2);
}
$money_json['price_fine_discount']>0 && $srv_detail.=',精品尊享包优惠:'.$money_json['price_fine_discount'];
}
$srv_info['detail'] = $srv_detail;
$row['srv_info'] = $srv_info;
//获取贷款信息
if (!$row['payway']) {
$auto_finance_row = $this->auto_finance_model->get(['id' => $row['finance_id']], 'fin_id,num');
$loan = $this->order_loans_model->get(['o_id' => $row['id']]);
$loan['status'] = intval($loan['status']);
$loan['notify_file'] = $loan['notify_file'] ? build_qiniu_image_url($loan['notify_file']) : '';
$loan['notify_file_name'] = $loan['notify_file'] ? end(explode('/', $loan['notify_file'])) : '';
$loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : '';
$loan['lend_file_name'] = $loan['lend_file'] ? end(explode('/', $loan['lend_file'])) : '';
$loan['finance_rows'] = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
$loan['finance_rows_nums'] = $this->sys_finance_model->get_nums();
$loan['price_loan'] = $money_json['price_loan'] ? $money_json['price_loan'] : '';
$loan['first_pay'] = 0;
if ($money_json['price_loan']) {
$srv_money = $this->orders_entity->order_srv_money($row['id']);
if ($srv_money > $deposit) {
$loan['first_pay'] = $sale_price - $money_json['price_loan'];
} else {
$loan['first_pay'] = $sale_price - $money_json['price_loan'] - $deposit;
}
}
!$loan['num'] && $loan['num'] = 12;
$loan['loan_time'] = $loan['loan_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($loan['loan_time'])) : '';
$row['loan_info'] = $loan;
}
//获取开票
$bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB,business_licence');
$bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
$bill['file_type'] = $bill['file'] && strstr($bill['file'], '.pdf') ? 'pdf' : 'img';
$bill['cardidA'] = $bill['cardidA'] ? array('value' => $bill['cardidA'], 'src' => build_qiniu_image_url($bill['cardidA'])) : array('value' => '', 'src' => '');
$bill['cardidB'] = $bill['cardidB'] ? array('value' => $bill['cardidB'], 'src' => build_qiniu_image_url($bill['cardidB'])) : array('value' => '', 'src' => '');
$bill['business_licence'] = $bill['business_licence'] ? array('value' => $bill['business_licence'], 'src' => build_qiniu_image_url($bill['business_licence'])) : array('value' => '', 'src' => '');
$bill['status'] = intval($bill['status']);
$row_goods['company_id'] && $item_company = $this->sys_company_model->get(['id'=>$row_goods['company_id']],'id,short');
if(!$item_company){
$item_html = '车辆归属<b>未选择</b>';
}else{
$item_html = "车辆公司归属<b>【{$item_company['short']}】</b>";
}
$pay_order = $this->app_liche_orders_model->get(['type'=>3,'status'=>1,'o_id'=>$row['id']],'mch_id');
$pay_order && $pay_compay = $this->sys_company_model->get(['wx_mchid' => $pay_order['mch_id']],'id,short');
$pay_html = '';
if($pay_compay){
$ck_html = $pay_compay['id'] == $item_company['id'] ? '<b class="am-text-success">一致</b>' : '<b class="am-text-warning">不一致</b>';
$pay_html = "与尾款收款公司<b>【{$pay_compay['short']}】</b> {$ck_html}";
}
$bill['warning'] = $item_html. $pay_html;
$row['bill'] = $bill;
//获取合同文件
$contracts = $this->order_contracts_model->select(['o_id' => $row['id'], 'status' => 1], '', '', '', 'type,file,status');
$contract_data = [];
if ($contracts) {
foreach ($contracts as $key => $val) {
$contract_data[$val['type']] = [
'type' => $val['type'],
'status_name' => $val['status'] ? '已签约' : '未签约'
];
}
}
$row['contract_data'] = $contract_data;
//获取销售员
if ($row['admin_id']) {
$this->load->model('app/licheb/app_licheb_users_model', 'licheb_users_model');
$this->load->model("biz/biz_model");
$row_admin = $this->licheb_users_model->get(array('id' => $row['admin_id']));
$biz_id = $row_admin['biz_id'];
$row_biz = array();
if ($biz_id) {
$row_biz = $this->biz_model->get(array('id' => $biz_id));
}
$admin_name = $row_admin ? "{$row_biz['biz_name']} {$row_admin['uname']}" : "";
$row['admin_name'] = $admin_name;
}
//获取代办信息
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
$imgs = $car_imgs = $register_img = [];
$company = $ins_risk = $business_risk = '';
$if_listed_db = $if_ins_db = 0;
if ($agent) {
$agent['if_ins'] = intval($agent['if_ins']);
$agent['ins_time'] = $agent['ins_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($agent['ins_time'])) : '';
$agent_jsondata = $agent['jsondata'] ? json_decode($agent['jsondata'], true) : '';
if ($agent_jsondata) {
$company = $agent_jsondata['company'];
$ins_risk = $agent_jsondata['ins_risk'];
$business_risk = $agent_jsondata['business_risk'];
$if_listed_db = intval($agent_jsondata['if_listed_db']);
$if_ins_db = intval($agent_jsondata['if_ins_db']);
if ($agent_jsondata['register_img']) {
$file_name = substr($agent_jsondata['register_img'], strrpos($agent['car_img'], '/') + 1);
$register_img[] = array(
'src' => build_qiniu_image_url($agent_jsondata['register_img']),
'value' => $agent_jsondata['register_img'],
'title' => $file_name
);
}
}
if ($agent['car_img']) {
$file_name = substr($agent['car_img'], strrpos($agent['car_img'], '/') + 1);
$car_imgs[] = array(
'src' => build_qiniu_image_url($agent['car_img']),
'value' => $agent['car_img'],
'title' => $file_name
);
}
if ($agent['ins_img']) {
$ins_img = json_decode($agent['ins_img']);
foreach ($ins_img as $val) {
$file_name = substr($val, strrpos($val, '/') + 1);
$imgs[] = [
'src' => build_qiniu_image_url($val),
'value' => $val,
'title' => $file_name
];
}
}
} else {
$agent['if_ins'] = 0;
$agent['car_img_src'] = '';
$agent['car_img'] = '';
}
$agent['company'] = $company;
$agent['ins_risk'] = $ins_risk;
$agent['business_risk'] = $business_risk;
$agent['if_listed_db'] = $if_listed_db;
$agent['if_ins_db'] = $if_ins_db;
$row['agent'] = $agent;
$row['bx_imgs'] = $imgs;
$row['car_imgs'] = $car_imgs;
$row['register_img'] = $register_img;
$info = $row;
$this->data['info'] = $info;
$this->data['_title'] = '订单详情';
return $this->show_view('receiver/orders/get', true);
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$result = '';
if ($params['type'] == 1) {//修改备注
$re = $this->orders_model->get(['id' => $params['id']]);
$jsondata = json_decode($re['jsondata'], true);
$jsondata['note'] = $params['note'];
$upd = array('jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE));
$result = $this->orders_model->update($upd, ['id' => $params['id']]);
} else if ($params['type'] == 2) {//修改营业执照
if (!$params['business_licence']) {
return $this->show_json(SYS_CODE_FAIL, '请上传营业执照');
}
if (!$this->order_bills_model->get(['o_id' => $params['id']])) {
$this->order_bills_model->add(['o_id' => $params['id'], 'c_time' => time()]);
}
$result = $this->order_bills_model->update(array('business_licence' => $params['business_licence']), ['o_id' => $params['id']]);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
/**
* 更新身份证信息
* @return bool
*/
function edit_cardID()
{
$o_id = $this->input->post('o_id');
$cardidA = $this->input->post('cardidA');
$cardidB = $this->input->post('cardidB');
if (!$this->order_bills_model->get(['o_id' => $o_id])) {
$this->order_bills_model->add(['o_id' => $o_id, 'c_time' => time()]);
}
if (!$cardidA || !$cardidB) {
return $this->show_json(SYS_CODE_FAIL, '请上传身份证照片');
}
$this->load->library('TcOrc');
$cardidA_src = build_qiniu_image_url($cardidA);
$result = $this->tcorc->IdentityCard($cardidA_src);
if (!$result['code']) {
return $this->show_json(SYS_CODE_FAIL, '身份证校验不通过');
} else {
//校验姓名
$uname = $result['data']['Name'];
$row_order = $this->orders_model->get(['id' => $o_id]);
if ($uname != $row_order['name']) {
return $this->show_json(SYS_CODE_FAIL, '身份证姓名与客户不一致');
}
}
$upd = array(
'cardidA' => $cardidA,
'cardidB' => $cardidB,
'status' => 1
);
$result = $this->order_bills_model->update($upd, ['o_id' => $o_id]);
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if ($params['export_type']) {
$result = $this->orderslist->export_data($params['status_pid'], $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
} else {
$fieldAry = $this->orderslist->get_fields($params['status_pid'], 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$indexs['admin_name'] = '销售顾问';
$result = $this->orderslist->lists($params['status_pid'], $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
//修改分期
public function edit_loan()
{
$params = $this->input->post();
$info = $params['info'];
$oid = $params['id'] ? $params['id'] : $info['id'];
$file = $_FILES['file'];
$row = $this->order_loans_model->get(['o_id' => $oid]);
if (!$row) {
$this->order_loans_model->add(['o_id' => $oid, 'c_time' => time()]);
$row = $this->order_loans_model->get(['o_id' => $oid]);
}
$update = [];
if ($file) { //上传按揭通知函
$path = FCPATH . 'temp/';
if (!file_exists($path)) {
$oldumask = umask(0);
mkdir($path, 0777, true);
umask($oldumask);
}
$file_name = md5($file['name'] . uniqid()) . '.' . end(explode('.', $file['name']));
$tmp = $path . $file_name;
move_uploaded_file($file['tmp_name'], $tmp);
if (!filesize($tmp)) {
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
}
$this->load->library('qiniu');
$res = $this->qiniu->save($file_name, file_get_contents($tmp));
unlink($tmp);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
}
$size = getimagesize($res['url']);
if ($params['type']) {
$update['lend_file'] = $res['file'];
} else {
$update['notify_file'] = $res['file'];
}
$this->data['file_url'] = build_qiniu_image_url($res['file']);
}
strlen($params['status']) && $update['status'] = $params['status'];
if ($params['status'] == 1) { //审核通过
$finance_id = $info['finance_id'];
$this->orders_model->update(['finance_id' => $finance_id], ['id' => $row['o_id']]);
} elseif ($params['status'] == 2) { //审核通过
if (!$row['notify_file']) {
return $this->show_json(SYS_CODE_FAIL, '请先上传按揭通知函!');
}
$finance_id = $info['finance_id'];
$price_loan = $info['loan_info']['price_loan'];
$update['num'] = $info['loan_info']['num'];
if (!$finance_id || !$price_loan || !$update['num']) {
return $this->show_json(SYS_CODE_FAIL, '请填写完整信息!');
}
$order_row = $this->orders_model->get(['id' => $row['o_id']], 'id,mobile,money_json');
$money_json = json_decode($order_row['money_json'], true);
$money_json['price_loan'] = $price_loan;
$this->orders_model->update(['finance_id' => $finance_id, 'money_json' => json_encode($money_json, JSON_UNESCAPED_UNICODE)], ['id' => $row['o_id']]);
//生成购车订单
$this->load->model('app/liche/app_liche_users_model');
$userinfo = $this->app_liche_users_model->get(['mobile'=>$order_row['mobile']]);
$this->orders_entity->check_finish_v2($order_row['id'],$userinfo);
} elseif ($params['status'] == 3) { //完成按揭
if (!$row['lend_file']) {
return $this->show_json(SYS_CODE_FAIL, '请先上传按揭放款函!');
}
$loan_time = $info['loan_info']['loan_time'];
if (!$loan_time) {
return $this->show_json(SYS_CODE_FAIL, '请选择放款时间!');
}
$update['loan_time'] = date('Y-m-d H:i:s', strtotime($loan_time));
}
$result = $this->order_loans_model->update($update, ['id' => $row['id']]);
if ($result) {
if ($params['status'] == 2) { //设置等待放款
$this->orders_model->update(['status' => 2], ['id' => $row['o_id']]);
$ckcar = $this->order_ckcars_model->get(['o_id' => $row['o_id']]);
if(!$ckcar){
$replace = [
'o_id' => $row['o_id'],
'status' => 0,
'c_time' => time()
];
$this->order_ckcars_model->add($replace);
}
} elseif ($params['status'] == 3) { //设置完成按揭
$order_row = $this->orders_model->get(['id' => $row['o_id']], 'status');
if ($order_row['status'] > 2) {
$agent_rows = $this->order_agents_model->get(['o_id' => $oid]); //判断是否代办完成
if ($agent_rows && $agent_rows['status']) {
$this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
}
}
} else {
$this->orders_model->update(['status' => 2], ['id' => $row['o_id']]);
$ckcar = $this->order_ckcars_model->get(['o_id' => $row['o_id']]);
$replace = [
'o_id' => $row['o_id'],
'status' => 0,
'c_time' => time()
];
$ckcar && $replace['id'] = $ckcar['id'];
$this->order_ckcars_model->replace($replace);
}
}
}
$this->data['params'] = $params;
return $result ? $this->show_json(SYS_CODE_SUCCESS, '保存成功') : $this->show_json(SYS_CODE_FAIL, '保存失败');
}
public function edit_item()
{
$this->load->model("items/items_model");
$id = $this->input->post('id');
$item_id = $this->input->post('item_id');
$row = $this->orders_model->get(['id' => $id]);
$ckcars = $this->order_ckcars_model->get(['o_id' => $id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$item_id) return $this->show_json(SYS_CODE_FAIL, '请选择车辆!');
if ($row['status'] > 3) {
return $this->show_json(SYS_CODE_FAIL, '已开票,不能修改!');
}
$res = $this->orders_model->update(['item_id' => $item_id], ['id' => $id]);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
if ($row['item_id'] && $row['item_id'] != $item_id) {
$this->items_model->update(['status' => 1], ['id' => $row['item_id']]);
}
$this->items_model->update(['status' => 2], ['id' => $item_id]);
if (!$ckcars) {
$add_data = [
'o_id' => $id,
'status' => 1,
'c_time' => time()
];
$result = $this->order_ckcars_model->add($add_data);
} else {
$result = $this->order_ckcars_model->update(['status' => 1], ['id' => $ckcars['id']]);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//查看发票信息
public function get_bill()
{
$oid = $this->input->get('oid');
$row = $this->orders_model->get(['id' => $oid]);
$bill = $this->order_bills_model->get(['o_id' => $oid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$bill && $row['status'] >= 3) {
$add_data = [
'o_id' => $row['id'],
'c_time' => time()
];
$bill['id'] = $this->order_bills_model->add($add_data);
}
$bill['src_file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
$bill['bill_time'] = $row['bill_time'] != '0000-00-00 00:00:00' ? $row['bill_time'] : '';
$this->data['bill'] = $bill;
return $this->show_view('receiver/orders/get_bill');
}
//编辑发票信息
public function edit_bill()
{
$id = $this->input->post('id');
$money = $this->input->post('money');
$file = $this->input->post('file');
$money && $update['money'] = $money;
$file && $update['file'] = $file;
$result = $this->order_bills_model->update($update, ['id' => $id]);
if ($result) {
//更新开票时间
$row = $this->order_bills_model->get(['id' => $id]);
$row_order = $this->orders_model->get(array('id' => $row['o_id']));
if ($row_order) {
$this->load->model('items/items_model');
$bill_time = date('Y-m-d H:i:s');
$upd = array('bill_time' => $bill_time);
$where = array('id' => $row_order['item_id']);
$ret = $this->items_model->update($upd, $where);
if ($ret) { //添加开票日志
$this->load->library('entity/items_entity');
$re_i = $this->items_model->get(['id' => $row_order['item_id']]);
$params = array('item_id' => $row_order['item_id'], 'type' => 3, 'uid' => $this->uid, 'uname' => $this->username
, 'com_time' => $bill_time, 'biz_id' => $re_i['biz_id'], 'addr_id' => $re_i['addr_id']);
$this->items_entity->add_log($params);
}
$this->orders_model->update(['bill_time' => $bill_time], ['id' => $row['o_id']]);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//确定交款
public function edit_jk()
{
$oid = $this->input->post('oid');
$row = $this->orders_model->get(['id' => $oid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if ($row['status'] != 3) {
return $this->show_json(SYS_CODE_FAIL, '修改失败,该订单不处于开票阶段');
}
$bill = $this->order_bills_model->get(['o_id' => $oid]);
if (!$bill['file'] || !$bill['money']) {
return $this->show_json(SYS_CODE_FAIL, '未上传开票文件或未填写到账金额!');
}
if (!$bill['cardidA'] && !$bill['business_licence']) {
return $this->show_json(SYS_CODE_FAIL, '未上传用户身份证或营业执照!');
}
$where = [
'o_id' => $oid,
'status' => 1,
'pay_price>' => 0
];
$sum = $this->app_liche_orders_model->sum('total_price', $where); //已收金额
$need_price = $this->orders_entity->recevable_price($oid); //应收金额
if ($sum['total_price'] < $need_price) {
return $this->show_json(SYS_CODE_FAIL, '修改失败,已收金额小于应收金额!');
}
$this->order_bills_model->update(['status' => 2], ['o_id' => $oid]);
$this->orders_model->update(['status' => 4], ['id' => $bill['o_id']]);
if (!$this->order_agents_model->get(['o_id' => $oid])) {
$this->order_agents_model->add(['o_id' => $oid, 'c_time' => time]);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//保存代办服务
public function edit_agent()
{
$params = $this->input->post();
$row = $this->orders_model->get(['id' => $params['oid']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
$jsondata = json_decode($agent['jsondata'],true);
$update = [];
$update['car_num'] = $params['car_num'];
$update['ins_time'] = $params['ins_time'] ? date('Y-m-d H:i:s', strtotime($params['ins_time'])) : '0000-00-00 00:00:00';
$update['car_img'] = $params['car_img'];
$update['if_ins'] = $params['ins_risk'] ? 1 : 0;
$jsondata['if_listed_db'] = intval($params['if_listed_db']);
$jsondata['if_ins_db'] = intval($params['if_ins_db']);
$jsondata['company'] = $params['company'];
$jsondata['ins_risk'] = $params['ins_risk'];
$jsondata['business_risk'] = $params['business_risk'];
$jsondata['register_img'] = $params['register_img'];
if ($params['bx_imgs']) {
$this->load->library('qiniuorc');
$imgs = explode(',', $params['bx_imgs']);
$update['ins_img'] = json_encode($imgs, JSON_UNESCAPED_UNICODE);
$old_ins_img = json_encode(json_decode($agent['ins_img'],true),JSON_UNESCAPED_UNICODE);
if($update['ins_img']!=$old_ins_img && is_array($imgs)){
//图片识别
foreach ($imgs as $key => $val) {
$url = build_qiniu_image_url($val);
$res = $this->qiniuorc->car_insure($url);
if($res['code']){
$company = $res['data']['保险公司'];
if(count($res['data']['投保险种'])>3){ //商业
$business_risk = (float)$res['data']['合计保费'];
}else{ //交强险
$ins_risk = (float)$res['data']['合计保费'];
}
$json_orc_ins[] = $res['data'];
}
}
}
if(!$params['company'] && $company){
$jsondata['company'] = $company;
}
if(!$params['ins_risk'] && $ins_risk){
$jsondata['ins_risk'] = $ins_risk;
}
if(!$params['business_risk'] && $business_risk){
$jsondata['business_risk'] = $business_risk;
}
$jsondata['ins_orc'] = $json_orc_ins;
}else{
$update['ins_img'] = null;
}
$update['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
if ($agent) {
if($agent['status']<0 && $row['status']>=4){
$update['status'] = 0;
}
$result = $this->order_agents_model->update($update, ['id' => $agent['id']]);
} else {
$update['o_id'] = $row['id'];
$update['c_time'] = time();
$result = $this->order_agents_model->add($update);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//确定代办
public function edit_agentfh()
{
$oid = $this->input->post('oid');
$row = $this->orders_model->get(['id' => $oid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if ($row['status'] < 4) {
return $this->show_json(SYS_CODE_FAIL, '修改失败,该订单不处于代办阶段');
}
$loan = $this->order_loans_model->get(['o_id' => $oid]);
if (!$row['payway'] && $loan['status'] != 3) { //分期且分期未完成
return $this->show_json(SYS_CODE_FAIL, '修改失败,请先完成按揭');
}
$this->order_agents_model->update(['status' => 1], ['o_id' => $oid]);
$row['status'] == 4 && $this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//获取合同图片
public function get_cimgs()
{
$type = $this->input->get('type');
$oid = $this->input->get('oid');
$row = $this->order_contracts_model->get(['type' => $type, 'o_id' => $oid]);
$info['title'] = '相册标题';
$info['id'] = '222';
$info['start'] = 0;
$data = [];
if ($row) {
$imgs = json_decode($row['imgs'], true);
foreach ($imgs as $key => $val) {
$data[] = [
'alt' => '图片名',
'pid' => $key,
'src' => build_qiniu_image_url($val),
'thumb' => build_qiniu_image_url($val)
];
}
}
$info['data'] = $data;
$this->data['info'] = $info;
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//支付列表
public function get_paylog()
{
$params = $this->input->get();
if ($params['d_type'] == 'ajax') {
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 10;
$list = [];
$p_row = $this->app_liche_orders_model->get(['o_id'=>$params['id'],'pid'=>0],'id');
$where = [
'o_id' => $params['id'],
'status' => 1,
'pay_price>' => 0
];
$count = $this->app_liche_orders_model->count($where);
if ($count) {
$rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time,mch_id,descrip,status,pid');
$type_arr = $this->app_liche_orders_model->get_type_arr();
foreach ($rows as $item) {
$company = '';
if ($item['mch_id']) {
$company = $this->sys_company_model->get(['wx_mchid' => $item['mch_id']], 'short');
}
$list[] = [
'id'=> $item['id'],
'money' => $item['total_price'],
'type_cn' => $type_arr[$item['type']],
'pay_time' => $item['pay_time'],
'company' => $company ? $company['short'] : '',
'descrip' => $item['descrip'],
];
}
}
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$params['id'],'status'=>1,'pay_price>'=>0]);
$this->data['pay_price'] = $sum['total_price'];
$this->data['need_price'] = $this->orders_entity->recevable_price($params['id']);
$this->data['list'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['commonPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orders/paylog');
}
//添加支付日志
public function add_paylog()
{
$id = $this->input->get_post('id');
$row = $this->orders_model->get(['id' => $id]);
$srv_price = $this->orders_entity->order_srv_money($row['id']);
if ($this->input->method() == 'post') {
$money = $this->input->post('money');
$pay_time = $this->input->post('pay_time');
$wx_mchid = $this->input->post('wx_mchid');
$descrip = $this->input->post('descrip');
$type = $this->input->post('type');
if (!$money || !$pay_time || !$row || !$wx_mchid) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$p_row = $this->app_liche_orders_model->get(['pid'=>0,'o_id'=>$row['id']]);
$this->load->helper('order');
$sid = create_order_no(350200, 'liche', 1, $type);
$data = [
'o_id' => $row['id'],
'sid' => $sid,
'mch_id' => $wx_mchid,
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'cor_id' => $row['cor_id'],
'incor_id' => $row['incor_id'],
'total_price' => $money,
'pay_price' => $money,
'type' => $type,
'status' => 0,
'c_time' => time()
];
$p_row['uid'] && $data['uid'] = $p_row['uid'];
$p_row['entrust_uid'] && $data['entrust_uid'] = $p_row['entrust_uid'];
$descrip && $data['descrip'] = $descrip;
if($type==1){ //定金
$data['pid'] = $p_row['id'];
$this->app_liche_orders_model->update(['status'=>-1],['type'=>1,'status'=>0,'o_id'=>$row['id']]);
}elseif($type==2){ //服务费
if(!$srv_price){
return $this->show_json(SYS_CODE_FAIL, '该订单不需要支付服务费');
}
$this->app_liche_orders_model->update(['status'=>-1],['type'=>2,'status'=>0,'o_id'=>$row['id']]);
$data['pid'] = $p_row['id'];
}elseif($type==3){ //尾款
$last_p_row = $this->app_liche_orders_model->get(['type'=>3,'pid'=>$p_row['id']]);
if(!$last_p_row){
return $this->show_json(SYS_CODE_FAIL, '该订单未到支付尾款阶段');
}
$data['pid'] = $last_p_row['id'];
$this->app_liche_orders_model->update(['status'=>-1],['type'=>3,'status'=>0,'o_id'=>$row['id'],'pid'=>$last_p_row['id']]);
//获取已支付尾款
$pay_sum = $this->app_liche_orders_model->sum('pay_price',['type'=>3,'status'=>1,'o_id'=>$row['id'],'pid'=>$last_p_row['id']]);
if($pay_sum['pay_price']+$money>$last_p_row['total_price']){
return $this->show_json(SYS_CODE_FAIL, '请输入正确尾款金额');
}
}elseif($type==5){
$data['status'] = 1;
$data['pay_time'] = $pay_time;
}else{
return $this->show_json(SYS_CODE_FAIL, '请选择正确订单类型');
}
$res = $this->app_liche_orders_model->add($data);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
if($type!=5){
$this->load->service('apporder/payment_service', array('app_id' => 1));
$result = $this->payment_service->after_pay_liche($sid,$money,'',$pay_time);
}
//更新客户为订单客户
$this->customers_model->update(['status'=>2],['id'=>$row['rid']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
$ck_row = $this->order_ckcars_model->get(['o_id'=>$id]);
$sign_row = $this->order_signs_model->get(['o_id'=>$id]);
$companys = $this->sys_company_model->select(['status' => 1, 'wx_mchid!=' => ''], 'id desc', '', '', 'id,wx_mchid,short');
$type = [];
if(!$row['status'] && $sign_row['status']==1){
$type[] = ['id'=>1,'name'=>'定金'];
}
if($row['status']==2 && $ck_row['status']==2){
$srv_price >0 && $type[] = ['id'=>2,'name'=>'服务费'];
$type[] = ['id'=>3,'name'=>'尾款'];
}
$type[] = ['id'=>5,'name'=>'后台添加'];
$this->data['type'] = $type;
$this->data['companys'] = $companys;
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orders/add_paylog');
}
//取消配车
public function edit_ckcar(){
$this->load->model('items/items_model');
$id = $this->input->post('id');
$row = $this->orders_model->get(['id'=>$id]);
if(!$row || !$row['item_id']){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$bill_row = $this->order_bills_model->get(['o_id'=>$id]);
$car_row = $this->order_ckcars_model->get(['o_id'=>$id]);
if($row['status']>3 || $bill_row['status']==2){
return $this->show_json(SYS_CODE_FAIL, '订单已开票,不能修改');
}
$res = $this->orders_model->update(['item_id'=>0,'status'=>2],['id'=>$row['id']]);
if($res){
$this->items_model->update(['status' => 1,'bill_time'=>'0000-00-00 00:00:00'], ['id' => $row['item_id']]);
//用户确认签名,删除重签签名
$con_row = $this->order_contracts_model->get(['o_id'=>$id,'type'=>2]);
if($con_row){
$this->order_contracts_model->delete(['o_id'=>$id,'type'=>2]);
$this->order_ckcars_model->update(['status'=>0],['id'=>$car_row['id']]);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
}
+255
View File
@@ -0,0 +1,255 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Tag extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_customer_tag_model', 'mdCustomerTag');
}
//首页信息
public function index()
{
return $this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$statusAry = $this->mdCustomerTag->statusAry();
$typeAry = $this->mdCustomerTag->typeAry();
$showAry = $this->mdCustomerTag->showAry();
$lists = array();
$where = ["status<>-1" => null, 'pid' => 0];
if (strlen($params['status'])) {
$where['status'] = $params['status'];
}
if (strlen($params['show'])) {
$where['show'] = $params['show'];
}
if ($params['type']) {
$where['type'] = $params['type'];
}
$count = $this->mdCustomerTag->count($where);
if ($count) {
$res = $this->mdCustomerTag->select($where, "sort desc,id desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['name'] = $value['name'];
$setValue['sort'] = $value['sort'];
$setValue['type_name'] = $typeAry[$value['type']];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $statusAry[$value['status']];
$setValue['show_name'] = $showAry[$value['show']];
$options = '';
$res_tag = $this->mdCustomerTag->select(["status" => 1, 'pid' => $value['id']], "sort desc,id desc", 0, 0, 'id,name,sort');
$res_tag && $options = implode(',', array_column($res_tag, 'name'));
$setValue['options'] = $options;
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry, 'showAry' => $showAry];
$this->data['_title'] = '客户标签列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/receiver/tag/lists', true);
}
public function get_options()
{
$id = intval($this->input->post('id'));
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$res_tag = $this->mdCustomerTag->select(["status" => 1, 'pid' => $id], "sort desc,id desc", 0, 0, 'id,name,sort,status,qy_id');
$this->data['lists'] = $res_tag;
return $this->show_json(SYS_CODE_SUCCESS);
}
//展示单条数据
public function get()
{
$id = intval($this->input->get('id'));
if ($id) {
$url = "/receiver/tag/edit";
$re = $this->mdCustomerTag->get(['id' => $id]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '客户标签不存在!');
}
$name = $re['name'];
$sort = $re['sort'];
$type = $re['type'];
$show = $re['show'];
} else {
$url = "/receiver/tag/add";
$name = '';
$sort = $show = 0;
$type = 'checkbox';
}
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'type' => $type, 'show' => $show,
'typeAry' => $this->mdCustomerTag->typeAry(), 'showAry' => $this->mdCustomerTag->showAry(), 'url' => $url];
return $this->show_view('/receiver/tag/edit');
}
//添加单条数据
public function add()
{
$params = $this->input->post();
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '标签名称不能为空!');
}
$re = $this->mdCustomerTag->get(array('name' => $params['name']));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!');
}
$id = $this->mdCustomerTag->add(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']
, 'show' => $params['show']]);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//编辑单条数据
public function edit()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '请输入标签名称');
}
$re = $this->mdCustomerTag->get(array('name' => $params['name'], 'status' => 1));
if ($re && $re['id'] != $params['id']) {
return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!');
}
$re = $this->mdCustomerTag->get(['id' => $params['id']]);
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn') && $re['qy_id']) {//正试才能修改企业标签
$this->load->library('wx_qyapi', ['app' => 'lichene']);
$this->wx_qyapi->get_external_contact(['url' => 'edit_corp_tag', 'id' => $re['qy_id']
, 'name' => $params['name'], 'order' => $params['sort']]);
}
$this->mdCustomerTag->update(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']
, 'show' => $params['show']], ['id' => $params['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//删除单条数据
public function del()
{
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re = $this->mdCustomerTag->get(['id' => $id]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '标签不存在!');
}
$this->mdCustomerTag->update(['status' => '-1'], ['id' => $id]);
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn') && $re['qy_id']) {//正试才能修改企业标签
$this->load->library('wx_qyapi', ['app' => 'lichene']);
$this->wx_qyapi->get_external_contact(['url' => 'del_corp_tag', 'group_id' => $re['qy_id']]);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//修改标签选项
function edit_options()
{
$pid = $this->input->post('id');
$options = $this->input->post('options');
if (!$pid || !$options) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdCustomerTag->get(['id' => $pid]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '客户标签不存在!');
}
$add_tag = $del_tag = $edit_tag = [];
foreach ($options as $key => $value) {
$sort = intval($value['sort']);
$data = ['name' => $value['name'], 'status' => $value['status'], 'sort' => $sort];
if ($value['status'] == -1 && $value['qy_id']) {//删除标签
$del_tag[] = $value['qy_id'];
}
if ($value['name']) {
if ($value['id']) {//修改
if ($value['status'] == 1 && $value['qy_id']) {
$edit_tag[] = ['id' => $value['qy_id'], 'name' => $value['name'], 'order' => $sort];
}
$this->mdCustomerTag->update($data, ['id' => $value['id']]);
} else {//新增
$add_tag[] = ['name' => $value['name'], 'order' => $sort];
$data['pid'] = $pid;
$this->mdCustomerTag->add($data);
}
}
}
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn')) {//正试才能修改企业标签
$this->load->library('wx_qyapi', ['app' => 'lichene']);
if (count($add_tag)) {//新增标签
if (!$re['qy_id']) {
$add_corp_tag = ['url' => 'add_corp_tag', 'group_id' => '', 'group_name' => $re['name']
, 'order' => $re['sort'], 'tag' => $add_tag];
} else {
$add_corp_tag = ['url' => 'add_corp_tag', 'group_id' => $re['qy_id'], 'tag' => $add_tag];
}
$re_yq = $this->wx_qyapi->get_external_contact($add_corp_tag);
if ($re_yq['errcode'] == 0) {
if (!$re['qy_id'] && $re_yq['tag_group']['group_id']) {//更新企微标签组id
$this->mdCustomerTag->update(['qy_id' => $re_yq['tag_group']['group_id']], ['id' => $pid]);
}
foreach ($re_yq['tag_group']['tag'] as $key => $value) {
if ($value['id']) {//更新企微标签id
$this->mdCustomerTag->update(['qy_id' => $value['id']], ['pid' => $pid, 'name' => $value['name']]);
}
}
}
} else if (count($edit_tag)) {//编辑标签
foreach ($edit_tag as $key => $value) {
$this->wx_qyapi->get_external_contact(['url' => 'edit_corp_tag', 'id' => $value['id']
, 'name' => $value['name'], 'order' => $value['order']]);
}
} else if (count($del_tag)) {//删除标签
foreach ($del_tag as $key => $value) {
$this->wx_qyapi->get_external_contact(['url' => 'del_corp_tag', 'tag_id' => $value]);
}
}
//$this->data = ['options' => $options, 'add_tag' => $add_tag, 'edit_tag' => $edit_tag, 'del_tag' => $del_tag];
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status()
{
$id = $this->input->post('id');
$stauts = intval($this->input->post('status'));
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->mdCustomerTag->update(['status' => $stauts], ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
}
@@ -0,0 +1,83 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:代办服务
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Agent extends HD_Controller{
private $status_pid = 4;
public function __construct(){
parent::__construct();
$this->load->library('OrdersList');
}
public function index(){
$this->lists();
}
public function lists(){
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get(){
}
//添加单条数据
public function add(){
}
//编辑单条数据
public function edit(){
}
//删除单条数据
public function del(){
}
//批量操作(默认修改状态)
public function batch(){
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+105
View File
@@ -0,0 +1,105 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:开票相关
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Bill extends HD_Controller
{
private $status_pid = 3;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
$this->load->model('items/items_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
!strlen($params['status']) && $params['status'] = 1;
$result = $this->orderslist->lists($this->status_pid, $params);
$params['status']==2 && $result['params']['show_bill_time'] = true;
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['bill_time']['title'] = '开票时间';
$fieldAry['vin']['title'] = '车架号';
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$item_arr_ids = array_unique(array_column($result['lists'],'item_id'));
$item_map = [];
if($item_arr_ids){
$str_ids = implode(',',$item_arr_ids);
$where = [
"id in ({$str_ids})" => null
];
$item_map = $this->items_model->map('id','vin',$where,'','','','id,vin');
}
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$value['vin'] = $item_map[$value['item_id']];
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
@@ -0,0 +1,91 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:车辆分配
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Ckcar extends HD_Controller
{
private $status_pid = 2;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+93
View File
@@ -0,0 +1,93 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:交易完成
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Deal extends HD_Controller
{
private $status_pid = 6;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$result['params']['show_bill_time'] = true;
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
@@ -0,0 +1,91 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:交付车辆
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Delivery extends HD_Controller
{
private $status_pid = 5;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+90
View File
@@ -0,0 +1,90 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:分期办理
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Loan extends HD_Controller
{
private $status_pid = 1;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
@@ -0,0 +1,91 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:退款
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Refund extends HD_Controller
{
private $status_pid = 7;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
+91
View File
@@ -0,0 +1,91 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:合同签订
* Created on: 2021/9/28 14:11
* Created by: dengbw
*/
class Sign extends HD_Controller
{
private $status_pid = 0;
public function __construct()
{
parent::__construct();
$this->load->library('OrdersList');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$result = $this->orderslist->lists($this->status_pid, $params);
$result['params']['sign'] = 1;
$this->data = $result;
return $this->show_view($result['view'], true);
}
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
if($params['export_type']){
$result = $this->orderslist->export_data($this->status_pid, $params);
$fileName = '保险明细';
$data = $result['data'];
$indexs = $result['indexs'];
}else{
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
$fieldAry['admin_name'] = ['title'=>'销售顾问'];
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->orderslist->lists($this->status_pid, $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
}
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
}
@@ -0,0 +1,963 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Orders extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model('receiver/order/receiver_order_status_model');
$this->load->model('receiver/order/receiver_order_datas_model');
$this->load->model('receiver/order/receiver_order_loans_model', 'order_loans_model');
$this->load->model('receiver/order/receiver_order_ckcars_model', 'order_ckcars_model');
$this->load->model('receiver/order/receiver_order_bills_model', 'order_bills_model');
$this->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
$this->load->model('receiver/order/receiver_order_contracts_model', 'order_contracts_model');
$this->load->model('receiver/order/receiver_order_oplogs_model','order_oplogs_model');
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_finance_model');
$this->load->model('sys/sys_finance_model');
$this->load->model('sys/sys_company_model');
$this->load->model("sys/sys_area_model");
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('app/app_checkdata_model');
$this->load->library('receiver/orders_entity');
$this->load->library('receiver/orders_v2_entity');
$this->load->library('receiver/orders_status_entity');
$this->load->library('receiver/order_datas_entity');
$this->load->library('Ordersv2List');
$this->load->library('qyrobot');
$this->load->library('TcOrc');
}
public function index()
{
$this->lists();
}
public function lists()
{
$old_oid = Orders_v2_entity::V2_START_ID;
$params = $this->input->get();
$statusAry = $this->receiver_order_status_model->statusAry();
$status_arr = array();
$t1 = 'lc_receiver_orders_v2';
$t2 = 'lc_receiver_order_status';
foreach ($statusAry as $key => $value) {
if (!$value['show']) {
continue;
}
$cate = $where = array();
$where["$t1.status<>"] = -1;
strlen($value['pid_status']) && $where["$t1.brand_id>"] = 0;
if(strlen($value['pid_status']) && $value['pid_status']){
$where["$t1.id>="] = $old_oid;
}
if(is_product()){
$where["{$t1}.brand_id<>3"] = null;//狸车品牌不显示
$where["{$t1}.biz_id<>1"] = null;//biz_id=1不显示
}
if ($value['list']) {
foreach ($value['list'] as $key2 => $value2) {
if($key2){
$where_s = [];
$key==1 && $where_s["{$t1}.payway"] = 0;//分期
if(strlen($key) && !$key && $key2==1){ //已下定过滤退款
$where_s["{$t1}.status <>"] = 2;
}
if($key==4){ //交付需要开票后才显示
$where_s["{$t1}.id in (select o_id from lc_receiver_order_status where pid_status=3 and status=1)"] = null;
}
if($key2){
$where_s["{$t2}.pid_status"] = $value['pid_status'];
$up_key = $key2+1;
$where_s["{$t2}.status in ({$key2},{$up_key})"] = null;
}
$where_s = array_merge($where,$where_s);
$having = 'total = 1';
if($key==0 && $key2==1){ //已付款
$having = 'total >= 1';
}
$count2 = $this->receiver_orders_v2_model->selectOrders($where_s,'','', '', 1,'',$having);
}else{
$where_s = [
"id not in (select o_id from lc_receiver_order_status where pid_status={$value['pid_status']} and status=1)" => null
];
$key==1 && $where_s['payway'] = 0;
$key==3 && $where_s['id in (select o_id from lc_receiver_order_status where pid_status=0 and status=2)'] = null;
if($key==4){ //交付需要开票后才显示
$where_s["{$t1}.id in (select o_id from lc_receiver_order_status where pid_status=3 and status=1)"] = null;
}
$where_s = array_merge($where,$where_s);
$count2 = $this->receiver_orders_v2_model->count($where_s);
}
$cate[] = array("id" => $key2, "name" => $value2, "count" => $count2);
}
}
$status_arr[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => 0);
}
$where = ["{$t1}.status<>" => -1];
if(is_product()){
$where["{$t1}.brand_id<>"] = 3;//狸车品牌不显示
$where["{$t1}.biz_id<>"] = 1;//biz_id=1不显示
}
$params['status_pid'] == 5 && $params['status'] = 1;
$params['count_all'] = $this->receiver_orders_v2_model->count($where);//全部
$params['list_type'] = 'all';
$result = $this->ordersv2list->lists($params['status_pid'], $params);
$this->data = $result;
$this->data['status_arr'] = $status_arr;
return $this->show_view($result['view'], true);
}
public function get()
{
$id = $this->input->get('id');
$row = $this->receiver_orders_v2_model->get(['id' => $id]);
$customers = $this->customers_model->get(['id' => $row['customer_id']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
if ($customers['of_id']) {//客户来源
$of_ary = $this->customers_model->offlineSources($customers['of_id']);
$of_title = $of_ary['name'];
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
$row['of_title'] = $of_title;
}
$money_json = json_decode($row['money_json'], true);
$deposit = $money_json['price_book'];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
$row['price_discount'] = $money_json['price_discount'];
//售价详细信息
$sale_detail = "指导价:".number_format($money_json['price_car'],2);
$money_json['price_discount'] && $sale_detail .= ',优惠金额:'.number_format($money_json['price_discount'],2);
$money_json['price_color'] && $sale_detail .= ',颜色加价:'.number_format($money_json['price_color'],2);
$money_json['price_coplus'] && $sale_detail .= ',公司加价:'.number_format($money_json['price_coplus'],2);
$row['sale_detail'] = $sale_detail;
$sale_price = $this->orders_v2_entity->total_price($row['id']);
$row['sale_price'] = number_format($sale_price, 2);
$row['info_json'] = json_decode($row['info_json'], true);
$row['status'] = intval($row['status']);
$row['price'] = number_format($money_json['price_car'], 2);
$row['deposit'] = number_format($deposit, 2);
$row['c_time'] = date('Y-m-d', $row['c_time']);
$row['payway'] = intval($row['payway']);
$row['item_id'] = intval($row['item_id']);
$row['cardid'] = $row['info_json']['c_cardid'] ? $row['info_json']['c_cardid'] :'';
$row['address'] = $row['info_json']['c_address'] ? $row['info_json']['c_address'] : '';
$row['owner_cardid'] = $row['info_json']['c_owner_cardid'] ? $row['info_json']['c_owner_cardid'] : '';
$row['credit'] = $row['info_json']['c_credit'] ? $row['info_json']['c_credit'] : '';
$row['company'] = $row['info_json']['c_company'] ? $row['info_json']['c_company'] : '';
$row['car_city_name'] = '';
if($row['info_json']['car_city_id']){
$city_row = $this->sys_area_model->get(['city_id'=>$row['info_json']['car_city_id']],'city_name');
$row['car_city_name'] = $city_row['city_name'];
}
$row['note'] = $jsondata['note'] ? $jsondata['note'] : '';
//获取车信息
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name');
$serie = $this->auto_series_model->get(['id' => $row['s_id']], 'name');
$row['brand_name'] = $brand['name'];
$row['s_name'] = $serie['name'];
$attr_arr = [$row['v_id'], $row['cor_id'], $row['incor_id']];
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
$row['v_name'] = isset($attr[$row['v_id']]) ? $attr[$row['v_id']][0]['title'] : '';
$row['cor_name'] = isset($attr[$row['cor_id']]) ? $attr[$row['cor_id']][0]['title'] : '';
$row['incor_name'] = isset($attr[$row['incor_id']]) ? $attr[$row['incor_id']][0]['title'] : '';
//获取选择车辆vin
if ($row['item_id']) {
$this->load->model('items/items_model', 'mdItems');
$row_goods = $this->mdItems->get(array('id' => $row['item_id']));
$row['vin'] = $row_goods['vin'];
}
$row['delry_time'] = $row['delry_time'] != '0000-00-00 00:00:00'
? str_replace(" 00:00:00", "", $row['delry_time']) : '';
//获取车辆服务费
$srv_info = $this->orders_v2_entity->order_srv_money($row['id'], 2);
$srv_info['total'] = number_format($srv_info['total'], 2);
$srv_detail = "";
if ($srv_info['list']) {
foreach ($srv_info['list'] as $key => $val) {
$d = $srv_detail ? ',' : '';
$srv_detail .= $d . $val['title'] . ":" . number_format($val['money'], 2);
}
}
$srv_info['detail'] = $srv_detail;
$row['srv_info'] = $srv_info;
//获取贷款信息
if (!$row['payway']) {
$loan = $this->order_loans_model->get(['o_id' => $row['id']]);
$loan['notify_file'] = $loan['notify_file'] ? build_qiniu_image_url($loan['notify_file']) : '';
$loan['notify_file_name'] = $loan['notify_file'] ? end(explode('/', $loan['notify_file'])) : '';
$loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : '';
$loan['lend_file_name'] = $loan['lend_file'] ? end(explode('/', $loan['lend_file'])) : '';
$loan['finance_rows'] = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
$loan['price_loan'] = $money_json['price_loan'] ? $money_json['price_loan'] : '';
$loan['first_pay'] = 0;
if ($money_json['price_loan']) {
$loan['first_pay'] = $sale_price - $money_json['price_loan'];
}
!$loan['num'] && $loan['num'] = 12;
$loan['loan_time'] = $loan['loan_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($loan['loan_time'])) : '';
$status_array = $this->receiver_order_status_model->select(['o_id'=>$row['id'],'pid_status'=>1],'','','id,status');
$loan['status_array'] = array_column($status_array,'status');
$row['loan_info'] = $loan;
}
//获取审核资料信息
$img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id'],'status>='=>0]);
$row['imgs_status'] = $this->order_datas_entity->data_ckinfo($img_data,$row['main_type']);
//获取开票
$bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file');
$bill_status = $this->receiver_order_status_model->get(['o_id'=>$row['id'],'pid_status'=>3,'status'=>1]); //是否已开票
$bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
$bill['file_type'] = $bill['file'] && strstr($bill['file'], '.pdf') ? 'pdf' : 'img';
$bill['cardidA'] = $img_data['cardida'];
$bill['cardidB'] = $img_data['cardidb'];
$bill['business_licence'] = $img_data['business_licence'];
$bill['status'] = $bill_status ? 1 : 0;
$row_goods['company_id'] && $item_company = $this->sys_company_model->get(['id'=>$row_goods['company_id']],'id,short');
if(!$item_company){
$item_html = '车辆归属<b>未选择</b>';
}else{
$item_html = "车辆公司归属<b>【{$item_company['short']}】</b>";
}
$pay_order = $this->app_liche_orders_model->get(['type'=>3,'status'=>1,'o_id'=>$row['id']],'mch_id');
$pay_order && $pay_compay = $this->sys_company_model->get(['wx_mchid' => $pay_order['mch_id']],'id,short');
$pay_html = '';
if($pay_compay){
$ck_html = $pay_compay['id'] == $item_company['id'] ? '<b class="am-text-success">一致</b>' : '<b class="am-text-warning">不一致</b>';
$pay_html = "与尾款收款公司<b>【{$pay_compay['short']}】</b> {$ck_html}";
}
$bill['warning'] = $item_html. $pay_html;
$row['bill'] = $bill;
//获取合同文件
$contracts = $this->order_contracts_model->select(['o_id' => $row['id'], 'status' => 1], '', '', '', 'id,type,file,status');
$contract_data = [];
if ($contracts) {
foreach ($contracts as $key => $val) {
$contract_data[$val['type']] = [
'type' => $val['type'],
'status' => $val['status'],
// 'src' => http_host_com('api').'/'.$val['file'],
'src' => http_host_com('api').'/wxapp/licheb/protocol/pdf_img?id='.$val['id'],
];
}
}
$row['contract_data'] = $contract_data;
//获取图片识别信息
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
$company = $ins_risk = $business_risk = '';
if ($agent) {
$agent['ins_time'] = $agent['ins_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($agent['ins_time'])) : '';
$agent_jsondata = $agent['jsondata'] ? json_decode($agent['jsondata'], true) : '';
if ($agent_jsondata) {
$company = $agent_jsondata['company'];
$ins_risk = $agent_jsondata['ins_risk'];
$business_risk = $agent_jsondata['business_risk'];
}
}
$agent['company'] = $company;
$agent['ins_risk'] = $ins_risk;
$agent['business_risk'] = $business_risk;
$row['agent'] = $agent;
//获取销售员
if ($row['sale_id']) {
$this->load->model('app/licheb/app_licheb_users_model', 'licheb_users_model');
$this->load->model("biz/biz_model");
$row_admin = $this->licheb_users_model->get(array('id' => $row['sale_id']));
$biz_id = $row_admin['biz_id'];
$row_biz = array();
if ($biz_id) {
$row_biz = $this->biz_model->get(array('id' => $biz_id));
}
$admin_name = $row_admin ? "{$row_biz['biz_name']} {$row_admin['uname']}" : "";
$row['admin_name'] = $admin_name;
}
//日志
$where = [
'order_id' => $row['id']
];
$logs = $this->order_oplogs_model->select($where,'id desc',1,30,'uname,log,c_time');
$info = $row;
$this->data['info'] = $info;
$this->data['logs'] = $logs;
$this->data['_title'] = '订单详情';
return $this->show_view('receiver/orderv2/get/index', true);
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$result = '';
if ($params['type'] == 1) {//修改备注
$re = $this->receiver_orders_v2_model->get(['id' => $params['id']]);
$jsondata = json_decode($re['jsondata'], true);
$jsondata['note'] = $params['note'];
$upd = array('jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE));
$result = $this->receiver_orders_v2_model->update($upd, ['id' => $params['id']]);
} else if ($params['type'] == 2) {//修改营业执照
if (!$params['business_licence']) {
return $this->show_json(SYS_CODE_FAIL, '请上传营业执照');
}
if (!$this->order_bills_model->get(['o_id' => $params['id']])) {
$this->order_bills_model->add(['o_id' => $params['id'], 'c_time' => time()]);
}
$result = $this->order_bills_model->update(array('business_licence' => $params['business_licence']), ['o_id' => $params['id']]);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
/**
* 更新身份证信息
* @return bool
*/
function edit_cardID()
{
$o_id = $this->input->post('o_id');
$cardidA = $this->input->post('cardidA');
$cardidB = $this->input->post('cardidB');
if (!$this->receiver_order_datas_model->get(['o_id' => $o_id])) {
$this->order_bills_model->add(['o_id' => $o_id, 'c_time' => time()]);
}
if (!$cardidA || !$cardidB) {
return $this->show_json(SYS_CODE_FAIL, '请上传身份证照片');
}
$cardidA_src = build_qiniu_image_url($cardidA);
$result = $this->tcorc->IdentityCard($cardidA_src);
if (!$result['code']) {
return $this->show_json(SYS_CODE_FAIL, '身份证校验不通过');
} else {
//校验姓名
$uname = $result['data']['Name'];
$row_order = $this->receiver_orders_v2_model->get(['id' => $o_id]);
if ($uname != $row_order['name']) {
return $this->show_json(SYS_CODE_FAIL, '身份证姓名与客户不一致');
}
}
$upd = array(
'cardidA' => $cardidA,
'cardidB' => $cardidB,
'status' => 1
);
$result = $this->order_bills_model->update($upd, ['o_id' => $o_id]);
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$indexs = [];
$fieldAry = $this->ordersv2list->get_fields($params['status_pid'], 1);
foreach ($fieldAry as $key => $value) {
$indexs[$key] = $value['title'];
}
$result = $this->ordersv2list->lists($params['status_pid'], $params);
$fileName = $result['_title'];
foreach ($result['lists'] as $key => $value) {
$temp = array();
foreach ($fieldAry as $key2 => $value2) {
$temp[$key2] = $value[$key2];
}
$data[] = $temp;
}
array_unshift($data, $indexs);
$this->load->library('excel');
return $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
//修改分期
public function edit_loan()
{
$params = $this->input->post();
$info = $params['info'];
$oid = $params['id'] ? $params['id'] : $info['id'];
$file = $_FILES['file'];
$row = $this->order_loans_model->get(['o_id' => $oid]);
if (!$row) {
$this->order_loans_model->add(['o_id' => $oid, 'c_time' => time()]);
$row = $this->order_loans_model->get(['o_id' => $oid]);
}
$update = [];
if ($file) { //上传按揭通知函
$path = FCPATH . 'temp/';
if (!file_exists($path)) {
$oldumask = umask(0);
mkdir($path, 0777, true);
umask($oldumask);
}
$file_name = md5($file['name'] . uniqid()) . '.' . end(explode('.', $file['name']));
$tmp = $path . $file_name;
move_uploaded_file($file['tmp_name'], $tmp);
if (!filesize($tmp)) {
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
}
$this->load->library('qiniu');
$res = $this->qiniu->save($file_name, file_get_contents($tmp));
unlink($tmp);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
}
if ($params['type']) {
$update['lend_file'] = $res['file'];
} else {
$update['notify_file'] = $res['file'];
}
$this->data['file_url'] = build_qiniu_image_url($res['file']);
}
strlen($params['status']) && $update['status'] = $params['status'];
if ($params['status'] == 1) { //等待放款
$finance_id = $info['finance_id'];
$price_loan = $info['loan_info']['price_loan'];
if (!$row['notify_file']) {
return $this->show_json(SYS_CODE_FAIL, '请先上传按揭通知函!');
}
if (!$finance_id || !$price_loan) {
return $this->show_json(SYS_CODE_FAIL, '请填写完整信息!');
}
$order_row = $this->receiver_orders_v2_model->get(['id' => $row['o_id']], 'id,mobile,money_json');
$money_json = json_decode($order_row['money_json'], true);
$money_json['price_loan'] = $price_loan;
$this->receiver_orders_v2_model->update(['finance_id' => $finance_id, 'money_json' => json_encode($money_json, JSON_UNESCAPED_UNICODE)], ['id' => $row['o_id']]);
//生成购车订单
$this->load->model('app/liche/app_liche_users_model');
$userinfo = $this->app_liche_users_model->get(['mobile'=>$order_row['mobile']]);
$this->orders_v2_entity->add_order($order_row['id'],$userinfo['id']);
$result = $this->orders_status_entity->set_status($oid,1,1);
}elseif($params['status'] == 2){ //完成按揭
$loan_time = $info['loan_info']['loan_time'];
if (!$loan_time) {
return $this->show_json(SYS_CODE_FAIL, '请选择放款时间!');
}
if (!$row['lend_file']) {
return $this->show_json(SYS_CODE_FAIL, '请先上传按揭放款函!');
}
$update['loan_time'] = date('Y-m-d H:i:s', strtotime($loan_time));
$result = $this->orders_status_entity->set_status($oid,1,2);
}
if($update){
$result = $this->order_loans_model->update($update, ['id' => $row['id']]);
}
return $result ? $this->show_json(SYS_CODE_SUCCESS, '保存成功') : $this->show_json(SYS_CODE_FAIL, '保存失败');
}
public function edit_item()
{
$this->load->model("items/items_model");
$id = $this->input->post('id');
$item_id = $this->input->post('item_id');
$row = $this->receiver_orders_v2_model->get(['id' => $id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$item_id) return $this->show_json(SYS_CODE_FAIL, '请选择车辆!');
// if ($this->receiver_order_status_model->get(['o_id'=>$id,'pid_status'=>3,'status'=>1])) {
// return $this->show_json(SYS_CODE_FAIL, '已开票,不能修改!');
// }
$res = $this->receiver_orders_v2_model->update(['item_id' => $item_id], ['id' => $id]);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
if ($row['item_id'] && $row['item_id'] != $item_id) {
$this->items_model->update(['status' => 1], ['id' => $row['item_id']]);
}
$result = $this->items_model->update(['status' => 2], ['id' => $item_id]);
if ($result) {
$this->orders_status_entity->set_status($id,2,1);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//查看发票信息
public function get_bill()
{
$oid = $this->input->get('oid');
$row = $this->receiver_orders_v2_model->get(['id' => $oid]);
$bill = $this->order_bills_model->get(['o_id' => $oid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$bill) {
$add_data = [
'o_id' => $row['id'],
'c_time' => time()
];
$bill['id'] = $this->order_bills_model->add($add_data);
}
$bill['src_file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
$bill['bill_time'] = $row['bill_time'] != '0000-00-00 00:00:00' ? $row['bill_time'] : '';
$this->data['bill'] = $bill;
return $this->show_view('receiver/orderv2/get/get_bill');
}
//编辑发票信息
public function edit_bill()
{
$id = $this->input->post('id');
$file = $this->input->post('value');
$row_order = $this->receiver_orders_v2_model->get(array('id' => $id));
if(!$file || !$row_order){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$row = $this->order_bills_model->get(['o_id' => $row_order['id']]);
if(!$row){
$jsondata = [];
$this->order_bills_model->add(['c_time'=>time(),'o_id'=>$row_order['id']]);
}else{
$jsondata = json_decode($row['jsondata'],true);
}
//图片识别
$img_url = build_qiniu_image_url($file);
$orc_res = $this->tcorc->CarInvoiceInfos($img_url);
if (!$orc_res['code']) {
return $this->show_json(SYS_CODE_FAIL, $orc_res['msg']);
}
$bill_time = date('Y-m-d H:i:s');
$carinfo = $orc_res['data']['CarInvoiceInfos'];
if(is_array($carinfo)){
foreach($carinfo as $kye=>$val){
if($val['Name']=='开票日期'){
$bill_time = $val['Value'];
break;
}
}
}
$jsondata['infos'] = $carinfo;
$update['file'] = $file;
$update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$result = $this->order_bills_model->update($update, ['o_id' => $row_order['id']]);
if ($result) {
//更新开票时间
$this->load->model('items/items_model');
$upd = array('bill_time' => $bill_time);
$where = array('id' => $row_order['item_id']);
$ret = $this->items_model->update($upd, $where);
if ($ret) { //添加开票日志
$this->load->library('entity/items_entity');
$re_i = $this->items_model->get(['id' => $row_order['item_id']]);
$params = array('item_id' => $row_order['item_id'], 'type' => 3, 'uid' => $this->uid, 'uname' => $this->username
, 'com_time' => $bill_time, 'biz_id' => $re_i['biz_id'], 'addr_id' => $re_i['addr_id']);
$this->items_entity->add_log($params);
}
$this->receiver_orders_v2_model->update(['bill_time' => $bill_time], ['id' => $row_order['id']]);
$this->orders_status_entity->set_status($row_order['id'],3,1);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//确定交款
public function edit_jk()
{
$oid = $this->input->post('oid');
$row = $this->receiver_orders_v2_model->get(['id' => $oid]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$bill = $this->order_bills_model->get(['o_id' => $oid]);
if (!$bill['file'] || !$bill['money']) {
return $this->show_json(SYS_CODE_FAIL, '未上传开票文件或未填写到账金额!');
}
$where = [
'o_id' => $oid,
'status' => 1,
'pay_price>' => 0
];
$sum = $this->app_liche_orders_model->sum('total_price', $where); //已收金额
$need_price = $this->orders_v2_entity->recevable_price($oid); //应收金额
if ($sum['total_price'] < $need_price) {
return $this->show_json(SYS_CODE_FAIL, '修改失败,已收金额小于应收金额!');
}
$this->order_bills_model->update(['status' => 2], ['o_id' => $oid]);
$this->orders_status_entity->set_status($oid,3,1);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//获取合同图片
public function get_cimgs()
{
$type = $this->input->get('type');
$oid = $this->input->get('oid');
$row = $this->order_contracts_model->get(['type' => $type, 'o_id' => $oid]);
$info['title'] = '相册标题';
$info['id'] = '222';
$info['start'] = 0;
$data = [];
if ($row) {
$imgs = json_decode($row['imgs'], true);
foreach ($imgs as $key => $val) {
$data[] = [
'alt' => '图片名',
'pid' => $key,
'src' => build_qiniu_image_url($val),
'thumb' => build_qiniu_image_url($val)
];
}
}
$info['data'] = $data;
$this->data['info'] = $info;
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//支付列表
public function get_paylog()
{
$params = $this->input->get();
if ($params['d_type'] == 'ajax') {
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 10;
$list = [];
$where = [
'o_id' => $params['id'],
'status' => 1,
"id not in (select id from lc_app_liche_orders where type=3 and o_id={$params['id']} and pay_price=0)" => null
];
$count = $this->app_liche_orders_model->count($where);
if ($count) {
$rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time,mch_id,descrip,status,pid,img,admin_id');
$type_arr = $this->app_liche_orders_model->get_type_arr();
foreach ($rows as $item) {
$company = '';
if ($item['mch_id']) {
$company = $this->sys_company_model->get(['wx_mchid' => $item['mch_id']], 'short');
}
$opt_name = '用户';
if($item['admin_id']){
$admin_user = $this->sys_admin_model->get(array('id' => $item['admin_id']),'username');
$opt_name = $admin_user['username'];
}
$list[] = [
'id'=> $item['id'],
'money' => $item['total_price'],
'type_cn' => $type_arr[$item['type']],
'pay_time' => $item['pay_time'],
'company' => $company ? $company['short'] : '',
'opt_name' => $opt_name,
'descrip' => $item['descrip'],
'img' => $item['img'] ? build_qiniu_image_url($item['img']) : '',
];
}
}
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$params['id'],'status'=>1,'pay_price>'=>0]);
$this->data['pay_price'] = $sum['total_price'];
$this->data['need_price'] = $this->orders_v2_entity->recevable_price($params['id']);
$this->data['list'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;
$this->data['commonPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orderv2/get/paylog');
}
//添加支付日志
public function add_paylog()
{
$id = $this->input->get_post('id');
$row = $this->receiver_orders_v2_model->get(['id' => $id]);
$srv_price = $this->orders_v2_entity->order_srv_money($row['id']);
$need_price = $this->orders_v2_entity->recevable_price($row['id']);
$car_price = $need_price-$srv_price;
if ($this->input->method() == 'post') {
$money = $this->input->post('money');
$pay_time = $this->input->post('pay_time');
$wx_mchid = $this->input->post('wx_mchid');
$descrip = $this->input->post('descrip');
$type = $this->input->post('type');
$img = $this->input->post('img');
if (!$money || !$pay_time || !$row || !$wx_mchid) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$p_row = $this->app_liche_orders_model->get(['pid'=>0,'o_id'=>$row['id']]);
$last_p_row = $this->app_liche_orders_model->get(['o_id'=>$row['id'],'type'=>3,'pid'=>$p_row['id'],'status>='=>0]); //尾款父订单
if($type==6){ //尾款
if($money>$car_price){
return $this->show_json(SYS_CODE_FAIL, '车款金额错误');
}
$this->app_liche_orders_model->update(['status'=>-1],['o_id'=>$row['id'],'status'=>0,'type'=>1]); //定金更新成无效订单
if(!$this->app_liche_orders_model->count(['pid'=>$last_p_row['id'],'type'=>3,'status'=>1])){
$this->app_liche_orders_model->update(['status'=>-1],['o_id'=>$row['id'],'type'=>3]); //尾款更新成无效订单
}
}else{ //服务费
if($money>$srv_price){
return $this->show_json(SYS_CODE_FAIL, '服务费金额错误');
}
$this->app_liche_orders_model->update(['status'=>-1],['o_id'=>$row['id'],'type'=>2,'status'=>0]); //未支付更新成无效订单
}
$this->load->helper('order');
$sid = create_order_no(350200, 'liche', 1, $type);
$data = [
'o_id' => $row['id'],
'sid' => $sid,
'pid' => $p_row['id'],
'mch_id' => $wx_mchid,
'admin_id' => $this->uid,
'brand_id' => $row['brand_id'],
's_id' => $row['s_id'],
'v_id' => $row['v_id'],
'cor_id' => $row['cor_id'],
'incor_id' => $row['incor_id'],
'total_price' => $money,
'pay_price' => $money,
'type' => $type,
'status' => 1,
'pay_time' => date('Y-m-d H:i:s',strtotime($pay_time)),
'c_time' => time()
];
$p_row['uid'] && $data['uid'] = $p_row['uid'];
$p_row['entrust_uid'] && $data['entrust_uid'] = $p_row['entrust_uid'];
$img && $data['img'] = $img;
$descrip && $data['descrip'] = $descrip;
$this->app_liche_orders_model->add($data);
if($this->app_liche_orders_model->count(['status'=>1,'o_id'=>$row['id']])==1 && $money>=100){ //企业微信推送
$this->orders_status_entity->set_status($row['id'],0,1);
if(date('Y-m-d',strtotime($pay_time))==date('Y-m-d')){ //当天
$this->qyrobot->deposit_notify_v2($row['id']);
}else{
$this->qyrobot->deposit_notify_v2($row['id'],1,$data['pay_time']);
}
}
$where = [
'status'=>1,
'o_id'=>$row['id'],
'pid>'=>0
];
$last_p_row && $where['id <>'] = $last_p_row['id'];
$is_pay = $this->app_liche_orders_model->sum('total_price',$where); //已支付金额
if($need_price && $is_pay['total_price']>=$need_price){ //完成支付
$this->app_liche_orders_model->update(['status'=>1],['o_id'=>$row['id'],'pid'=>0]);//主订单设置成支付
$last_p_row && $this->app_liche_orders_model->update(['status'=>1],['id'=>$last_p_row['id']]);//完成未支付尾款
$this->orders_status_entity->set_status($row['id'],0,2);
}
// if(!$this->order_contracts_model->count(['o_id'=>$row['id']])){ //生成合同
// $url = http_host_com('api').'/pdfapi/add_pdf?oid='.$row['id'];
// $pdf_res = file_get_contents($url);
// }
if($row['order_time'] == '0000-00-00 00:00:00'){ //更新下定时间
$this->receiver_orders_v2_model->update(['order_time' => date('Y-m-d H:i:s',strtotime($pay_time))], ['id' => $row['id']]);
}
//更新客户为订单客户
$this->customers_model->update(['status'=>2],['id'=>$row['customer_id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
$companys = $this->sys_company_model->select(['status' => 1, 'wx_mchid!=' => ''], 'id desc', '', '', 'id,wx_mchid,short');
$type = [];
$srv_price >0 && $type[] = ['id'=>2,'name'=>'服务费'];
$type[] = ['id'=>6,'name'=>'车款'];
$this->data['type'] = $type;
$this->data['companys'] = $companys;
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orderv2/get/add_paylog');
}
//取消配车
public function edit_ckcar(){
$this->load->model('items/items_model');
$id = $this->input->post('id');
$row = $this->receiver_orders_v2_model->get(['id'=>$id]);
if(!$row || !$row['item_id']){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if ($this->receiver_order_status_model->get(['o_id'=>$id,'pid_status'=>3,'status'=>1])) {
return $this->show_json(SYS_CODE_FAIL, '订单已开票,不能修改!');
}
$res = $this->receiver_orders_v2_model->update(['item_id'=>0],['id'=>$row['id']]);
if($res){
$this->items_model->update(['status' => 1,'bill_time'=>'0000-00-00 00:00:00'], ['id' => $row['item_id']]);
$this->receiver_order_status_model->delete(['o_id'=>$id,'pid_status'=>2,'status'=>1]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//修改图片
public function edit_imgs(){
$id = $this->input->post('id');
$field = $this->input->post('filed');
$value = $this->input->post('value');
$row = $this->receiver_orders_v2_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re_data = $this->receiver_order_datas_model->get(['o_id'=>$id]);
if(!$re_data){
$re_data_id = $this->receiver_order_datas_model->add(['c_time'=>time(),'o_id'=>$id]);
}else{
$re_data_id = $re_data['id'];
}
if($field=='ins_img' || $field=='other_img'){
$val_arr = json_decode($row[$field],true);
$val_arr[] = $value;
$value = json_encode($val_arr,JSON_UNESCAPED_UNICODE);
}
$update = [
$field => $value
];
//识别行驶证
if($field=='car_img'){
$result = $this->tcorc->VehicleLicense(build_qiniu_image_url($value));
if (!$result['code']) {
return $this->show_json(SYS_CODE_FAIL, '图片识别失败,请重新上传');
}
$jsondata = json_decode($re_data['jsondata'],true);
$jsondata['car_info'] = $result['data']['FrontInfo'];
$update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
}
$res = $this->receiver_order_datas_model->update($update,['id'=>$re_data_id]);
if($res){
$this->orders_status_entity->set_status($id,6,1);
if($field=='ins_img'){//保单识别图片保存数据
$this->order_datas_entity->orc_ins_img($id);
}
if($field=='car_img'){//更新车牌号
$this->order_datas_entity->up_car_num($id);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
public function edit_ckimg(){
$type = $this->input->post('type');
$ifcheck = $this->input->post('ifcheck');
$o_id = $this->input->post('id');
$img_data = $this->receiver_order_datas_model->get(['o_id'=>$o_id]);
if(!$img_data){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$ck_row = $this->app_checkdata_model->get(['cf_id'=>$img_data['id'],'app_id'=>2,'type'=>$type]);
if($ck_row){
$update = [
'ifcheck' => $ifcheck ? 1 : -1,
];
$res = $this->app_checkdata_model->update($update,['id'=>$ck_row['id']]);
}else{
$add_data = [
'cf_id' => $img_data['id'],
'app_id' => 2,
'type' => $type,
'datatype' => 'img',
'ifcheck' => $ifcheck ? 1 : -1,
'c_time' => time()
];
$res = $this->app_checkdata_model->add($add_data);
}
if($res){
$count = $this->app_checkdata_model->count(['ifcheck'=>1,'cf_id'=>$img_data['id'],'datatype'=>'img']);
if($count==5){
$this->orders_status_entity->set_status($img_data['o_id'],6,2);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//修改资料信息
public function edit_agent(){
$params = $this->input->post();
$row = $this->receiver_orders_v2_model->get(['id' => $params['oid']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
$jsondata = json_decode($agent['jsondata'],true);
$update = [];
$update['car_num'] = $params['car_num'];
$update['ins_time'] = $params['ins_time'] ? date('Y-m-d H:i:s', strtotime($params['ins_time'])) : '0000-00-00 00:00:00';
$jsondata['company'] = $params['company'];
$jsondata['ins_risk'] = $params['ins_risk'];
$jsondata['business_risk'] = $params['business_risk'];
$update['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
if ($agent) {
$result = $this->order_agents_model->update($update, ['id' => $agent['id']]);
} else {
$update['o_id'] = $row['id'];
$update['c_time'] = time();
$result = $this->order_agents_model->add($update);
}
if ($result) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
//修改支付订单状态
public function edit_status(){
if($this->input->method()=='post'){
$id = $this->input->post('id');
$row = $this->receiver_orders_v2_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '订单不存在');
}
$res = $this->receiver_orders_v2_model->update(['status'=>2,'refund_time'=>date('Y-m-d H:i:s')],['id'=>$id]);
if($res){
$this->app_liche_orders_model->update(['stat4us'=>-1],['o_id'=>$row['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '修改成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
return $this->show_view('receiver/orderv2/edit_status');
}
}
+288
View File
@@ -0,0 +1,288 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/8/20
* Time: 17:46
*/
class Addr extends HD_Controller{
protected $log_dir;
function __construct(){
parent::__construct();
$this->load->model("sys/sys_addr_model", 'addr_model');
$this->load->model("area_model");
$this->log_dir = 'sys_' . get_class($this);
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$where = array('province_id' => '350');
if($params['title']){
$where["title like '%{$params['title']}%'"] = null;
}
if($params['city_id']){
$where['city_id'] = $params['city_id'];
} else {
$params['city_id'] = '';
}
if($params['county_id']){
$where['county_id'] = $params['county_id'];
} else {
$params['county_id'] = '';
}
if(strlen($params['status'])>0){
$where['status'] = $params['status'];
} else {
$where['status>-1'] = null;
$params['status'] = '';
}
$total = $this->addr_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title, city_name, county_name, status';
$rows = $this->addr_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
'city_name' => $v['city_name'],
'county_name' => $v['county_name'],
'status' => $v['status'],
'status_name' => 1 == $v['status'] ? '开启' : '停用',
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count'=>ceil($total/$size),'curr'=>$page,'totle'=>$total);
$this->data['_title'] = '地址管理';
$this->show_view('sys/addr/lists',true);
}
function json_lists(){
$params = $this->input->get();
$page = $params['page'];
$size = $params['size'];
$where = array('province_id' => '350');
if($params['title']){
$where["title like '%{$params['title']}%'"] = null;
}
if($params['city_id']){
$where['city_id'] = $params['city_id'];
} else {
$params['city_id'] = '';
}
if($params['county_id']){
$where['county_id'] = $params['county_id'];
} else {
$params['county_id'] = '';
}
if(strlen($params['status'])>0){
$where['status'] = $params['status'];
} else {
$where['status>-1'] = null;
$params['status'] = '';
}
$total = $this->addr_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->addr_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data['lists'] = $lists;
$this->data['total'] = $total;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function get(){
$id = $this->input->get('id');
if($id){
$row = $this->addr_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['title'],
'city_id' => $row['city_id'],
'county_id' => $row['county_id'],
);
$action = '/sys/addr/edit';
$title = '编辑地址';
} else {
$info = array(
'title' => '',
'city_id' => '',
'county_id' => '',
);
$action = '/sys/addr/add';
$title = '新增地址';
}
$this->data['info'] = $info;
$this->data['action'] = $action;
$this->data['_title'] = $title;
$this->show_view('sys/addr/get');
}
public function add(){
$info = $this->input->post('info');
$title = trim($info['title']);
$city_id = $info['city_id'];
$county_id = $info['county_id'];
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入地址');
}
if(!$city_id){
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
if(!$county_id){
return $this->show_json(SYS_CODE_FAIL, '请选行政区');
}
$where = array(
"title like '{$title}'" => null,
'county_id' => $county_id
);
$count = $this->addr_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '地址已存在');
}
//获取行政区信息
$where = array('county_id' => $county_id);
$row_area = $this->area_model->get($where);
if(!$row_area){
return $this->show_json(SYS_CODE_FAIL, '行政区不存在');
}
$add = array(
'title' => $title,
'province_id' => $row_area['province_id'],
'province_name' => $row_area['province_name'],
'city_id' => $row_area['city_id'],
'city_name' => $row_area['city_name'],
'county_id' => $row_area['county_id'],
'county_name' => $row_area['county_name'],
'status' => 1
);
$ret = $this->addr_model->add($add);
if(!$ret){
debug_log("[error]# " . $this->addr_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function edit(){
$info = $this->input->post('info');
$title = trim($info['title']);
$city_id = $info['city_id'];
$county_id = $info['county_id'];
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入地址');
}
if(!$city_id){
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
if(!$county_id){
return $this->show_json(SYS_CODE_FAIL, '请选行政区');
}
$where = array(
"title like '{$title}'" => null,
"id<>{$info['id']}" => null,
'county_id' => $county_id
);
$count = $this->addr_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '地址已存在');
}
//获取行政区信息
$where = array('county_id' => $county_id);
$row_area = $this->area_model->get($where);
if(!$row_area){
return $this->show_json(SYS_CODE_FAIL, '行政区不存在');
}
$upd = array(
'title' => $title,
'province_id' => $row_area['province_id'],
'province_name' => $row_area['province_name'],
'city_id' => $row_area['city_id'],
'city_name' => $row_area['city_name'],
'county_id' => $row_area['county_id'],
'county_name' => $row_area['county_name'],
);
$ret = $this->addr_model->update($upd, array('id' => $info['id']));
if(!$ret){
debug_log("[error]# " . $this->company_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status(){
$id = $this->input->post('id');
$status = $this->input->post('status');
$upd = array('status' => $status);
$where = array('id' => $id);
$ret = $this->addr_model->update($upd, $where);
if(!$ret){
debug_log("[error]# " . $this->addr_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
// TODO: Implement del() method.
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
}
+227
View File
@@ -0,0 +1,227 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/7/29
* Time: 17:38
*/
class Company extends HD_Controller{
protected $log_dir;
function __construct(){
parent::__construct();
$this->load->model("sys/sys_company_model", 'company_model');
$this->log_dir = 'sys_' . get_class($this);
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
$where = array();
if ($params['keyword']){
$where["(title like '%{$params['keyword']}%' or short like '%{$params['keyword']}%')"] = null;
}
if(strlen($params['status']) > 0){
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$statusAry = $this->company_model->status_ary();
$typeAry = $this->company_model->type_ary();
$count = $this->company_model->count($where);
$lists = array();
if($count){
$orderby = 'id desc';
$select = 'id, title, short, status, city_id,type';
$rows = $this->company_model->select($where, $orderby, $page, $size, $select);
$city_ids = array_column($rows,'city_id') ? implode(',',array_column($rows,'city_id')) : '';
$city_lists = [];
$city_ids && $city_lists = $this->sys_city_model->map('city_id','name',["city_id in ({$city_ids})"=>null],'','','','city_id,name');
foreach($rows as $k => $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
'short' => $v['short'],
'status' => $v['status'],
'status_name' => $statusAry[$v['status']],
'type_name' => $typeAry[$v['type']],
'city_name' => $city_lists[$v['city_id']] ? $city_lists[$v['city_id']] : '',
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['pager'] = array('count'=>ceil($count/$size),'curr'=>$page,'totle'=>$count);
$this->data['_title'] = '公司管理';
$this->show_view('sys/company/lists',true);
}
public function get(){
$id = $this->input->get('id');
if($id){
$row = $this->company_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['title'],
'short' => $row['short'],
'credit_code' => $row['credit_code'],
'wx_mchid' => $row['wx_mchid'],
'img_seal' => $row['img_seal'],
'img_seal_url' => $row['img_seal'] ? build_qiniu_image_url($row['img_seal']) : '',
'status' => $row['status'],
'city_id' => $row['city_id'] ? $row['city_id'] : '',
'type' => $row['type']
);
$action = '/sys/company/edit';
$title = '编辑公司';
} else {
$info = array(
'title' => '',
'short' => '',
'credit_code' => '',
'wx_mchid' => '',
'status' => 0,
'city_id' => '',
'type' => 0
);
$action = '/sys/company/add';
$title = '新增公司';
}
$city_lists = $this->sys_city_model->select(['status'=>1],'id desc','','','city_id,name');
$this->data['city_lists'] = $city_lists;
$this->data['info'] = $info;
$this->data['action'] = $action;
$this->data['statusAry'] = $this->company_model->status_ary();
$this->data['typeAry'] = $this->company_model->type_ary();
$this->data['_title'] = $title;
$this->show_view('sys/company/get');
}
public function add(){
$info = $this->input->post('info');
$title = trim($info['title']);
$short = trim($info['short']);
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入公司名称');
}
if(!$short){
return $this->show_json(SYS_CODE_FAIL, '请输入公司简称');
}
if(!$info['city_id']){
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
$where = array("title like '{$title}'" => null);
$count = $this->company_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '公司已存在');
}
$add = array(
'title' => $title,
'short' => $short,
'credit_code' => $info['credit_code'] ? $info['credit_code'] : '',
'wx_mchid' => $info['wx_mchid'] ? $info['wx_mchid'] : '',
'img_seal' => $info['img_seal'] ? $info['img_seal'] : '',
'status' => intval($info['status']),
'city_id' => $info['city_id'],
'type' => intval($info['type'])
);
$id = $this->company_model->add($add);
if(!$id){
debug_log("[error]# " . $this->company_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function edit(){
$info = $this->input->post('info');
$title = trim($info['title']);
$short = trim($info['short']);
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入公司名称');
}
if(!$short){
return $this->show_json(SYS_CODE_FAIL, '请输入公司简称');
}
if(!$info['city_id']){
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
$where = array("title like '{$title}'" => null, "id<>{$info['id']}" => null);
$count = $this->company_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '公司已存在');
}
$upd = array(
'title' => $title,
'short' => $short ? $short : '',
'credit_code' => $info['credit_code'] ? $info['credit_code'] : '',
'wx_mchid' => $info['wx_mchid'] ? $info['wx_mchid'] : '',
'img_seal' => $info['img_seal'] ? $info['img_seal'] : '',
'status' => intval($info['status']),
'city_id' => $info['city_id'],
'type' => intval($info['type'])
);
$ret = $this->company_model->update($upd, array('id' => $info['id']));
if(!$ret){
debug_log("[error]# " . $this->company_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status(){
$id = $this->input->post('id');
$status = $this->input->post('status');
$upd = array('status' => $status);
$where = array('id' => $id);
$ret = $this->company_model->update($upd, $where);
if(!$ret){
debug_log("[error]# " . $this->company_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
// TODO: Implement del() method.
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
}
+199
View File
@@ -0,0 +1,199 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: xuxb
* Date: 2021/7/30
* Time: 10:52
*/
class Finance extends HD_Controller{
protected $log_dir;
function __construct(){
parent::__construct();
$this->load->model("sys/sys_finance_model", 'finance_model');
$this->log_dir = 'sys_' . get_class($this);
}
public function index(){
return $this->lists();
}
public function lists(){
$params = $this->input->get();
$where = array();
if ($params['keyword']){
$where["(title like '%{$params['keyword']}%')"] = null;
}
if(strlen($params['status']) > 0){
$where['status'] = $params['status'];
} else {
$params['status'] = '';
}
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $params['size'];
$size = !$size ? 20 : $size;
$statusAry = $this->finance_model->status_ary();
$count = $this->finance_model->count($where);
$lists = array();
if($count){
$orderby = 'id desc';
$select = 'id, title, money_min, money_max, first_pay, month_min, month_max, status';
$rows = $this->finance_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $k => $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
'money' => "{$v['money_min']}-{$v['money_max']}",
'first_pay' => $v['first_pay'],
"month" => "{$v['month_min']}-{$v['month_max']}",
'status' => $v['status'],
'status_name' => $statusAry[$v['status']],
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['statusAry'] = $statusAry;
$this->data['pager'] = array('count'=>ceil($count/$size),'curr'=>$page,'totle'=>$count);
$this->data['_title'] = '金融产品';
$this->show_view('sys/finance/lists',true);
}
public function get(){
$id = $this->input->get('id');
if($id){
$row = $this->finance_model->get(array('id' => $id));
$info = array(
'id' => $row['id'],
'title' => $row['title'],
'logo' => $row['logo'],
'logo_url' => $row['logo'] ? build_qiniu_image_url($row['logo']) : '',
'money_min' => $row['money_min'],
'money_max' => $row['money_max'],
'first_pay' => $row['first_pay'],
'month_min' => $row['month_min'],
'month_max' => $row['month_max'],
'status' => $row['status'],
);
$action = '/sys/finance/edit';
$title = '编辑金融产品';
} else {
$info = array(
'title' => '',
'status' => 0,
);
$action = '/sys/finance/add';
$title = '新增金融产品';
}
$this->data['info'] = $info;
$this->data['action'] = $action;
$this->data['statusAry'] = $this->finance_model->status_ary();
$this->data['_title'] = $title;
$this->show_view('sys/finance/get');
}
public function add(){
$info = $this->input->post('info');
$title = trim($info['title']);
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入标题');
}
$where = array("title like '{$title}'" => null);
$count = $this->finance_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '产品已经存在');
}
$add = array(
'title' => $title,
'logo' => $info['logo'] ? $info['logo'] : '',
'money_min' => floatval($info['money_min']),
'money_max' => floatval($info['money_max']),
'first_pay' => floatval($info['first_pay']),
'month_min' => intval($info['month_min']),
'month_max' => intval($info['month_max']),
'status' => intval($info['status']),
);
$id = $this->finance_model->add($add);
if(!$id){
debug_log("[error]# " . $this->finance_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function edit(){
$info = $this->input->post('info');
$title = trim($info['title']);
if(!$title){
return $this->show_json(SYS_CODE_FAIL, '请输入产品名称');
}
$where = array("title like '{$title}'" => null, "id<>{$info['id']}" => null);
$count = $this->finance_model->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, '产品已存在');
}
$upd = array(
'title' => $title,
'logo' => $info['logo'] ? $info['logo'] : '',
'money_min' => floatval($info['money_min']),
'money_max' => floatval($info['money_max']),
'first_pay' => floatval($info['first_pay']),
'month_min' => intval($info['month_min']),
'month_max' => intval($info['month_max']),
'status' => intval($info['status']),
);
$ret = $this->finance_model->update($upd, array('id' => $info['id']));
if(!$ret){
debug_log("[error]# " . $this->finance_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status(){
$id = $this->input->post('id');
$status = $this->input->post('status');
$upd = array('status' => $status);
$where = array('id' => $id);
$ret = $this->finance_model->update($upd, $where);
if(!$ret){
debug_log("[error]# " . $this->finance_model->db->last_query(), __FUNCTION__, $this->log_dir);
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
// TODO: Implement del() method.
}
public function batch(){
// TODO: Implement batch() method.
}
public function export(){
// TODO: Implement export() method.
}
}
+15 -34
View File
@@ -11,6 +11,7 @@ class Admin extends HD_Controller {
$this->load->model('sys/Sys_category_model','sysCate');
$this->load->model('sys/Sys_city_model','sysCity');
$this->load->model('app/app_model');
$this->load->model('biz/biz_model');
}
public function index()
@@ -83,19 +84,13 @@ class Admin extends HD_Controller {
$this->data = $this->_get_info();
$data = $this->sysAdmin->get(['id' => $id]);
$json = (array)json_decode($data['other_json']);
if(isset($json['cate_id'])) {
$this->data['cate_id'] = array_combine($json['cate_id'], $json['cate_id']);
}
if(isset($json['city_id'])) {
if(is_array($json['city_id'])) {
$this->data['city_id'] = array_combine($json['city_id'], $json['city_id']);
}
}
if(isset($json['platfrom_id']) && is_array($json['platfrom_id'])) {
$this->data['platfrom_id'] = array_combine($json['platfrom_id'], $json['platfrom_id']);
}
if(isset($json['app_id']) && is_array($json['app_id'])) {
$this->data['app_id'] = array_combine($json['app_id'], $json['app_id']);
//获取已选门店
if($json['biz_id']){
$ids = implode(',',$json['biz_id']);
$where = [
"id in ($ids)" => null
];
$this->data['selectBiz'] = $this->biz_model->select($where,'','','','id,biz_name as title');
}
$this->data['username'] = $data['username'];
$this->data['role_id'] = $data['role_id'];
@@ -141,17 +136,13 @@ class Admin extends HD_Controller {
}
//输入流数据获取
$input = $this->_get_input();
$other_json = [];
$input['biz_id'] && $other_json['biz_id'] = $input['biz_id'];
$insert = [
'username' => $input['username'],
'mobile' => $input['mobile'],
'role_id' => $input['role'],
'role_id' => $input['role'],
'other_json' => json_encode([
'cate_id' => $input['category'],
'city_id' => $input['city'],
'platfrom_id' => $input['platfrom'],
'app_id' => $input['apps'],
]),
'other_json' => json_encode($other_json,JSON_UNESCAPED_UNICODE),
'password' => password_hash($input['password1'],PASSWORD_BCRYPT),
'c_time' => time(),
];
@@ -168,16 +159,13 @@ class Admin extends HD_Controller {
}
//输入流数据获取
$input = $this->_get_input();
$other_json = [];
$input['biz_id'] && $other_json['biz_id'] = $input['biz_id'];
$upd = [
'username' => $input['username'],
'mobile' => $input['mobile'],
'role_id' => $input['role'],
'other_json' => json_encode([
'cate_id' => $input['category'],
'city_id' => $input['city'],
'platfrom_id' => $input['platfrom'],
'app_id' => $input['apps'],
]),
'other_json' => json_encode($other_json,JSON_UNESCAPED_UNICODE),
];
if($this->sysAdmin->update($upd,['id' => $input['id']])) {
return $this->show_json(SYS_CODE_SUCCESS,'修改成功!');
@@ -209,10 +197,6 @@ class Admin extends HD_Controller {
private function _get_info()
{
$data['role'] = $this->sysRole->select(['status' => '1'],'','','','id,name');
$data['category'] = $this->sysCate->select(['pid' => '0', 'status' => '1']);
$data['city'] = $this->sysCity->select(['status' => '1']);
$data['platfrom'] = array(0=>'总后台',1=>'商家后台');
$data['apps'] = $this->app_model->select(array(),'','','','id,name');
return $data;
}
@@ -265,16 +249,13 @@ class Admin extends HD_Controller {
{
$data = [
'id' => $this->input->post('id'),
'category' => $this->input->post('category'),
'city' => $this->input->post('city[]'),
'platfrom' => $this->input->post('platfrom[]'),
'username' => trim($this->input->post('username')),
'mobile' => trim($this->input->post('mobile')),
'status' => $this->input->post('status'),
'role' => $this->input->post('role'),
'apps' => $this->input->post('apps'),
'password1' => trim($this->input->post('password1')),
'password2' => trim($this->input->post('password2')),
'biz_id' => $this->input->post('biz_id'),
];
return $data;
}
+153 -12
View File
@@ -11,11 +11,16 @@ class City extends HD_Controller{
private $city = array('北京市', '上海市', '重庆市', '天津市');
protected $log_dir;
public function __construct()
{
parent::__construct();
$this->load->model("area_model");
$this->load->model("sys/sys_city_model");
$this->load->model('sys/sys_area_model');
$this->log_dir = 'sys_' . get_class($this);
}
public function index()
{
@@ -23,26 +28,73 @@ class City extends HD_Controller{
}
public function lists()
{
$this->data['bizname'] = $bizname = $this->input->get('bizname');
if ($bizname){
$where['name like \'%'.$bizname.'%\''] = null;
$params = $this->input->get();
$where = array();
if ($params['keyword']){
$where["name like '%{$params['keyword']}%'"] = null;
}
$page = $this->input->get('page');
$page = $params['page'];
$page = !$page ? 1 : $page;
$size = $this->input->get('size');
$size = $params['size'];
$size = !$size ? 20 : $size;
$lists = $this->sys_city_model->select($where,'id desc',$page,$size);
$count = $this->sys_city_model->count($where);
$lists = array();
if($count){
$rows = $this->sys_city_model->select($where,'id desc',$page,$size);
$map_checked = array();
$city_checked = array();
if($rows){
$city_ids = array_column($rows, 'city_id');
$str_ids = implode(',', $city_ids);
//获取城市下所有的区域
$where = array("city_id in ({$str_ids})" => null);
$orderby = 'city_id asc, county_id asc';
$select = 'city_id, county_id, county_name';
$rows_county = $this->area_model->select($where, $orderby, 0, 0, $select);
//获取已经选择的区域
$orderby = 'city_id asc, county_id asc';
$select = 'county_id, status';
$map_county = $this->sys_area_model->map('county_id', 'status', $where, $orderby, 0, 0, $select);
if($rows_county){
foreach($rows_county as $k => $v){
$city_id = $v['city_id'];
$county_id = $v['county_id'];
$checked = 1==$map_county[$county_id] ? 1 : 0;
$map_checked[$city_id][] = array(
'county_id' => $county_id,
'county_name' => $v['county_name'],
'checked' => $checked,
);
1 == $checked && $city_checked[$city_id] = $checked;
}
}
}
foreach($rows as $k => $v){
$city_id = $v['city_id'];
$lists[] = array(
'id' => $v['id'],
'city_id' => $city_id,
'firstchar' => $v['firstchar'],
'name' => $v['name'],
'fee_carno' => sprintf('%.2f', $v['fee_carno']),
'checked' => $city_checked[$city_id] ? 1 : 0,
'countys' => $map_checked[$city_id] ? $map_checked[$city_id] : array(),
);
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count'=>ceil($count/$size),'curr'=>$page,'totle'=>$count);
$this->data['_title'] = '城市管理';
$this->data['city_lists'] = $lists;
$this->data['pager']['total'] = $count;
$this->data['status_arr'] = array(1=>'开启',0=>'关闭');
$this->show_view('sys/city/lists',true);
}
public function get()
{
$info = array('province_id' => '350', 'city_id' => '', 'name' => '', 'firstchar' => '',);//默认添加福建城市
$this->data['info'] = $info;
$this->data['_title'] = '新增城市';
$this->show_view('sys/city/edit');
}
@@ -73,6 +125,13 @@ class City extends HD_Controller{
if(!$firstchar || empty($firstchar)){
return $this->show_json(SYS_CODE_FAIL, '首字母不能为空');
}
//判断是否重复
$row = $this->sys_city_model->get(array('city_id' => $city_id));
if($row){
return $this->show_json(SYS_CODE_FAIL, '该城市已经添加');
}
$data = array(
'city_id' => $city_id,
'name' => $name,
@@ -85,15 +144,97 @@ class City extends HD_Controller{
{
}
/**
* 保存选中的区域
* @return bool
*/
function edit_areas(){
$lists = $this->input->post('lists');
$lists = json_decode($lists, true);
$add_ids = array();//需要新增选中的区域ID
$del_ids = array();//需要删除区域的城市ID
foreach($lists as $k => $v){
$upd = array('status' => $v['checked'] ? 1 : 0);
$where = array('id' => $v['id']);
//更新城市的状态
$ret = $this->sys_city_model->update($upd, $where);
if($ret){
$del_ids[] = $v['city_id'];
foreach($v['countys'] as $k_county => $v_county){
if($v_county['checked']){
$add_ids[] = $v_county['county_id'];
}
}
}
}
if($del_ids){
//删除旧的选中区域
$str_ids = implode(',', $del_ids);
$where = array("city_id in ({$str_ids})" => null);
$ret = $this->sys_area_model->delete($where);
}
if($add_ids){
//新增选中的区域
$adds = array();
$str_ids = implode(',', $add_ids);
$where = array("county_id in ({$str_ids})" => null);
$orderby = 'county_id asc';
$select = 'province_id, province_name, city_id, city_name, county_id, county_name';
$rows = $this->area_model->select($where, $orderby, 0, 0, $select);
foreach($rows as $v){
$adds[] = array(
'province_id' => $v['province_id'],
'province_name' => $v['province_name'],
'city_id' => $v['city_id'],
'city_name' => $v['city_name'],
'county_id' => $v['county_id'],
'county_name' => $v['county_name'],
'status' => 1,
);
}
if($adds){
$ret = $this->sys_area_model->add_batch($adds);
}
}
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}
/**
* 保存挂牌价
* @return bool
*/
function edit_fee(){
$lists = $this->input->post('lists');
$lists = json_decode($lists, true);
foreach($lists as $k => $v){
$upd = array('fee_carno' => $v['fee_carno']);
$where = array('id' => $v['id']);
//更新城市的状态
$ret = $this->sys_city_model->update($upd, $where);
if(!$ret){
debug_log("[error]# " . $this->sys_city_model->db->last_query(), __FUNCTION__, $this->log_dir);
}
}
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}
public function del()
{
$id = $this->input->post('id');
$stauts = $this->input->post('status');
if($id)
{
$this->sys_city_model->update(array('status' => $stauts), array('id' => $id));
$where = array('id' => $id);
$row = $this->sys_city_model->get($where);
$ret = $this->sys_city_model->delete($where);
if($ret){
$where = array('city_id' => $row['city_id']);
$this->sys_area_model->delete($where);
}
}
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
return $this->show_json(SYS_CODE_SUCCESS,'操作成功');
}
public function batch()
{
+329
View File
@@ -0,0 +1,329 @@
<?php
/**
* Notes:报名管理
* Created on: 2020/5/18 12:45
* Created by: dengbw
* @return bool
*/
Class Enroll extends HD_Controller
{
private $statusAry = array(-1 => '已失效', 0 => '未核销', 1 => '已核销');
public function __construct()
{
parent::__construct();
$this->load->model('topics/topics_model', 'mdTopics');
$this->load->model('topics/topic_modules_model', 'mdTopicModules');
$this->load->model('topics/topic_module_enroll_model', 'mdModuleEnroll');
$this->load->model('topics/topic_module_enrolldata_model', 'mdModuleEnrolldata');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['module_id'] = intval($params['module_id']);
$res = $this->dataSelect($params);
if ($res['code'] == 0) {
return $this->show_json(SYS_CODE_FAIL, $res['msg']);
}
$lists = $res['lists'];
$count = $res['count'];
$this->data['params'] = $res['params'];
$this->data['_title'] = $res['title'] . '列表';
$this->data['type'] = $res['type'];
$this->data['statusAry'] = $this->statusAry;
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
return $this->show_view('topics/enroll/lists', true);
}
/**
* 报名活动列表
* @return bool
*/
public function lists_module()
{
$params = $this->input->get();
$page = $params['page'] ? $params['page'] : 1;
$size = $params['size'] ? $params['size'] : 20;
$app_id = $params['app_id'];
$search_ary = array("title" => "标题", "module_id" => "ID");
//根据应用获取模块
$where = array('app_id' => $app_id);
$rows_topic = $this->mdTopics->select($where);
$module_ids = array();
if ($rows_topic) {
foreach ($rows_topic as $v) {
if ($v['module_ids']) {
$ids = explode(',', $v['module_ids']);
if ($ids) {
$module_ids = array_merge($module_ids, $ids);
}
}
}
}
$total = 0;
$lists = array();
if ($module_ids) {
$str_ids = implode(',', $module_ids);
$where = array("module_id in ({$str_ids})" => null);
if ($params['search_v']) {
if ('title' == $params['search_k']) {
$where["m.title like '%{$params['search_v']}%'"] = null;
} else {
$where["m.{$params['search_k']}"] = $params['search_v'];
}
}
!$params['search_k'] && $params['search_k'] = 'title';
if (strlen($params['status']) > 0) {
$where['j.status'] = $params['status'];
} else {
$where['j.status>=0'] = null;
$params['status'] = '';
}
$total = $this->mdModuleEnroll->count_status($where);
if ($total) {
$orderby = 'id desc';
$select = "module_id, title, es_time, ee_time, as_time, ae_time, j.status";
$rows = $this->mdModuleEnroll->select_status($where, $orderby, $page, $size, $select);
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['module_id'],
'title' => $v['title'],
'e_time' => "{$v['es_time']}~{$v['ee_time']}",
'a_time' => "{$v['as_time']}~{$v['ae_time']}",
'status' => $v['status'],
'statusion' => 1 == $v['status'] ? "正常" : "下架",
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['search_ary'] = $search_ary;
$this->data['_title'] = '报名活动管理';
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
return $this->show_view('topics/enroll/lists_module', true);
}
/**
* Notes:查找报名数据
* Created on: 2020/5/19 16:37
* Created by: dengbw
* @param $params
* @return array
*/
private function dataSelect($params)
{
$where = $lists = array();
$title = '活动报名';
$type = 0;
if ($params['module_id']) {
$where['module_id'] = $params['module_id'];
$row_en = $this->mdModuleEnroll->get(array('module_id' => $params['module_id']), 'title,type');
$title = $row_en['title'];
$type = $row_en['type'];
} else {
//根据应用获取报名列表
$app_id = $params['app_id'];
$where_topic = array('app_id' => $app_id);
$rows_topic = $this->mdTopics->select($where_topic);
$module_ids = array();
if ($rows_topic) {
foreach ($rows_topic as $v) {
if ($v['module_ids']) {
$ids = explode(',', $v['module_ids']);
if ($ids) {
$module_ids = array_merge($module_ids, $ids);
}
}
}
}
if ($module_ids) {
$str_ids = implode(',', $module_ids);
$where["module_id in ({$str_ids})"] = null;
} else {
$where['module_id'] = -1;
}
}
if (status_verify($params['status'])) {
$where['status'] = $params['status'];
} else {
$params['status'] = -99;
}
if ($params['name']) {
$where['name like "%' . $params['name'] . '%"'] = null;
}
if ($params['mobile']) {
$where['mobile'] = $params['mobile'];
}
if ($params['code']) {
$where['code'] = $params['code'];
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
$count = $this->mdModuleEnrolldata->count($where);
if ($count) {
$select = "id,module_id,name,mobile,code,status,c_time,jsondata";
$lists = $this->mdModuleEnrolldata->select($where, "id desc", $params['page'], $params['size'], $select);
$map_module = array();
if ($lists) {
$module_ids = array_unique(array_column($lists, 'module_id'));
$str_ids = implode(',', $module_ids);
$where_module = array("module_id in ({$str_ids})" => null);
$map_module = $this->mdModuleEnroll->map('module_id', '*', $where_module, '', 0, 0, 'module_id, title, descrip');
}
foreach ($lists as $key => $value) {
$json = json_decode($value['jsondata'], true);
$module = $map_module[$value['module_id']];
$lists[$key]['c_time'] = date('Y-m-d H:i', $value['c_time']);
$lists[$key]['status_name'] = $this->statusAry[$value['status']];
$lists[$key]['remark'] = $json['remark'] ? $json['remark'] : '';
$lists[$key]['title'] = $module['descrip'] ? $module['descrip'] : $module['title'];
}
}
$data['code'] = SYS_CODE_SUCCESS;
$data['type'] = $type;
$data['title'] = $title;
$data['lists'] = $lists;
$data['count'] = $count;
$data['params'] = $params;
return $data;
}
public function get()
{
$id = intval($this->input->get('id'));
$module_id = intval($this->input->get('module_id'));
if (!$id || !$module_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdModuleEnrolldata->get(array("id" => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '报名详情不存在!');
}
$reEn = $this->mdModuleEnroll->get(array('module_id' => $module_id), 'enroll_json,type');
$enroll_json = array();
if ($reEn['enroll_json'] && $re['jsondata']) {
$enroll_json = json_decode($reEn['enroll_json'], true);
$jsondata = json_decode($re['jsondata'], true);
foreach ($enroll_json as $key => $value) {
$jsondata[$key] && $enroll_json[$key]['value'] = $jsondata[$key];
}
}
$re['enroll_json'] = $enroll_json;
$re['type'] = $reEn['type'];
$re['c_time'] = date('Y-m-d H:i', $re['c_time']);
$re['status_name'] = $this->statusAry[$re['status']];
$this->data['info'] = $re;
return $this->show_view('topics/enroll/edit');
}
public function del()
{
// TODO: Implement del() method.
}
public function batch()
{
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$params['export'] = 1;
$data = $indexs = array();
$res = $this->dataSelect($params);
if ($params['module_id']) {
if ($params['type'] == 1) {
$fileName = '活动报名用户';
foreach ($res['lists'] as $key => $value) {
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['code'] = $value['code'];
$temp['status_name'] = $value['status_name'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'name' => '姓名',
'mobile' => '手机号',
'code' => '核销码',
'status_name' => '状态',
'c_time' => '报名时间',
"remark" => "备注",
];
} else {
$fileName = '报名用户';
foreach ($res['lists'] as $key => $value) {
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'name' => '姓名',
'mobile' => '手机号',
'c_time' => '报名时间',
"remark" => "备注",
];
}
} else {
$fileName = '活动报名';
foreach ($res['lists'] as $key => $value) {
$temp['title'] = $value['title'];
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'title' => '活动名称',
'name' => '姓名',
'mobile' => '手机号',
'c_time' => '报名时间',
"remark" => "备注",
];
}
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
public function add()
{
// TODO: Implement add() method.
}
public function edit()
{
// TODO: Implement edit() method.
}
}
File diff suppressed because it is too large Load Diff
+21
View File
@@ -104,4 +104,25 @@ abstract class HD_Controller extends CI_Controller
return false;
}
/**
* 获取可以管理的城市
* @param null $def
* @return mixed
*/
protected function city_ary($def = null){
$this->load->model("sys/sys_city_model", 'city_model');
if(!is_null($def)){
return '';
}
$where = array('status' => 1);
$orderby = "id desc";
$select = "city_id, name";
$map_city = $this->city_model->map('city_id', 'name', $where, $orderby, 0, 0, $select);
return $map_city;
}
}
+17 -14
View File
@@ -40,12 +40,13 @@ class Auth {
$admin_user = $CI->sys_admin_model->get(array('id' => $user_info['id']));
$ip = get_client_ip();
$ip_arr = array();
if($this->is_ignore($user_info['id'])){
if(SUPER_ADMIN == $admin_user['role_id']){
//超级管理员免检
} else if($this->is_ignore($user_info['id'])){
//免检
} elseif(false !== strpos($_SERVER['HTTP_HOST'], "hd-admin.dev.xiaoyu.com") || false !== strpos($_SERVER['HTTP_HOST'], "admin.test.haodian.cn")){
} elseif(false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")){
//开发测试免检
} elseif(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) && $ip != $admin_user['login_ip'])
{
} elseif(filter_var($ip, FILTER_VALIDATE_IP) && $ip != $admin_user['login_ip']) {
$CI->load->model('sys/sys_config_model');
$config_ip = $CI->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL,"k" => "site"));
$ip_arr = array();
@@ -57,16 +58,16 @@ class Auth {
$ip_arr = array_merge($ip_arr, array_column($CI->sys_admin_model->select(array(),'','','','login_ip'), 'login_ip'));
if(!in_array($ip, $ip_arr) && $dir)
{
$admin_info = array(
'id' => $admin_user['id'],
);
$domain = explode('.', $_SERVER['HTTP_HOST']);
array_shift($domain);
$domain = implode('.', $domain);
$CI->input->set_cookie(LOGIN_COOKIE, $CI->encryption->encrypt(json_encode($admin_info)), time() + 86400, $domain);
$this->returnMsg('访问IP发生变化,请重新登录', '/login/check_view');
if($admin_user['id'] > 10){//管理员id>10去掉验证码登录
$admin_info = array(
'id' => $admin_user['id'],
);
$domain = explode('.', $_SERVER['HTTP_HOST']);
array_shift($domain);
$domain = implode('.', $domain);
$CI->input->set_cookie(LOGIN_COOKIE, $CI->encryption->encrypt(json_encode($admin_info)), time() + 86400, $domain);
$this->returnMsg('访问IP发生变化,请重新登录', '/login/check_view');
}
}
}
@@ -162,6 +163,8 @@ class Auth {
if(!$role['status'])
{
return $this->returnMsg('您的权限已被禁用');
} elseif('json' == $methods[0]){
//弹框等公共搜索使用,无需菜单权限校验
}
else
{
File diff suppressed because it is too large Load Diff
+535
View File
@@ -0,0 +1,535 @@
<?php
/**
* 订单管理列表
*/
class Ordersv2List
{
private $ci;
private $searchTpAry = array('owner_name' => '车主姓名', 'owner_mobile' => '车主手机号', 'name' => '客户姓名', 'mobile' => '客户手机号', 'sid' => '订单号');
private $paywayAry = array(0 => '贷款', 1 => '全款');
private $overAry = array(0 => '7天内', 1 => '14天内', 2=> '30天内', 3=> '大于30天');
private $t1 = 'lc_receiver_orders_v2';
private $t2 = 'lc_receiver_order_status';
public function __construct()
{
$this->ci = &get_instance();
$this->ci->load->model('receiver/order/receiver_orders_v2_model', 'mdOrders');
$this->ci->load->model('receiver/order/receiver_order_status_model');
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
$this->ci->load->model("biz/biz_model");
$this->ci->load->model('auto/auto_series_model');
$this->ci->load->model('auto/auto_brand_model');
$this->ci->load->model('auto/auto_attr_model');
$this->ci->load->model('items/items_model', 'mdItems');
$this->ci->load->library('receiver/orders_v2_entity');
$this->ci->load->library('receiver/orders_status_entity');
}
public function lists($status_pid, $params = array())
{
// $result = $show_info = array();
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!strlen($params['payway']) && $params['payway'] = '';
!$params['biz_type'] && $params['biz_type'] = '';
!strlen($params['over_id']) && $params['over_id'] = '';
$fieldAry = $this->get_fields($status_pid);
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
$show_info['overAry'] = $this->overAry;
$show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
//渠道经理
$show_info['qdjl_lists'] = $this->ci->mdLichebUsers->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0')
, 'id desc', 0, 0, 'id,uname as name');
if($params['status_pid']==12){ //意向金订单
$result = $this->inten_orders($params);
}else{
$result = $this->orders($params);
}
$result['show_info'] = $show_info;
$result['fieldAry'] = $fieldAry;
return $result;
}
/**
* Notes:全部订单
* Created on: 2021/9/18 15:13
* Created by: dengbw
* @param array $params
* @return array
*/
private function orders($params = array())
{
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$status_arr = $this->ci->receiver_order_status_model->statusAry();
$order_status_cn = $this->ci->mdOrders->get_status();
$view_type = 'orders';
$where = [
"{$this->t1}.status>=" => 0,
];
$_title = '全部订单';
$view = 'receiver/orderv2/lists';
$params['status_pid'] == 1 && $where["{$this->t1}.payway"] = 0;
if (is_product()) {
$where["{$this->t1}.biz_id<>"] = 1;
}
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["{$this->t1}.biz_id in ($biz_ids)"] = null;
}
if ($params['biz_type']) {
$where["{$this->t1}.biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ' and status=1)'] = null;
}
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where["{$this->t1}.customer_id in (select id from lc_receiver_customers where " . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["{$this->t1}.payway"] = $params['payway'];
}
if ($params['qdjl_id']) {//渠道经理
$where["{$this->t1}.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
if ($params['title']) {
$where["{$this->t1}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
//创建时间
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
if ($c_time[0]) {
$where["{$this->t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
}
if ($c_time[1]) {
$where["{$this->t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
}
//下定时间
if ($params['order_time']) {
$order_time = explode(' ~ ', $params['order_time']);
if ($order_time[0]) {
$where["{$this->t1}.order_time >="] = $order_time[0] . ' 00:00:00';
}
if ($order_time[1]) {
$where["{$this->t1}.order_time <="] = $order_time[1] . ' 23:59:59';
}
}
//开票时间
if ($params['bill_time']) {
$bill_time = explode(' ~ ', $params['bill_time']);
if ($bill_time[0]) {
$where["{$this->t1}.bill_time >="] = $bill_time[0] . ' 00:00:00';
}
if ($bill_time[1]) {
$where["{$this->t1}.bill_time <="] = $bill_time[1] . ' 23:59:59';
}
}
//交付时长
if(strlen($params['over_id'])){
if($params['over_id']==3){
$where["{$this->t1}.over_time>"] = date('Y-m-d',time()+30*24*60*60);
}else{
if($params['over_id']==1) {
$e_day = 14;
}elseif($params['over_id']==2){
$e_day = 30;
}else{
$e_day = 7;
}
$where["{$this->t1}.over_time<="] = date('Y-m-d',time()+$e_day*24*60*60);
}
}
if ($params['brand_id']) {//品牌
$where["{$this->t1}.brand_id"] = $params['brand_id'];
} else {
if (is_product()) {
$where["{$this->t1}.brand_id<>"] = 3;//狸车品牌不显示
}
$params['brand_id'] = '';
}
if ($params['s_id']) {//车系
$where["{$this->t1}.s_id"] = $params['s_id'];
} else {
$params['s_id'] = '';
}
if ($params['v_id']) {//车型
$where["{$this->t1}.v_id"] = $params['v_id'];
} else {
$params['v_id'] = '';
}
if ($params['cor_id']) {//车身颜色
$where["{$this->t1}.cor_id"] = $params['cor_id'];
} else {
$params['cor_id'] = '';
}
//销售员筛选
if ($params['admin_id']) {
$where["{$this->t1}.sale_id"] = $params['admin_id'];
} else {
if ($params['biz_id_admin']) {//指定店铺所有销售员
$where["{$this->t1}.biz_id"] = $params['biz_id_admin'];
} else {
//指定城市的所有门店
$where_biz = array();
if ($params['county_id_admin']) {
$where_biz['county_id'] = $params['county_id_admin'];
} else if ($params['city_id_admin']) {
$where_biz['city_id'] = $params['city_id_admin'];
}
if ($where_biz) {
$where_biz['status>-1'] = null;
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($rows_biz) {
$str_ids = implode(',', array_column($rows_biz, 'id'));
$where["{$this->t1}.biz_id in({$str_ids})"] = null;
} else {
$where["{$this->t1}.biz_id"] = -1;
}
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
if ($params['vin']) {
$where = ["{$this->t1}.status>=" => 0];
$where["{$this->t1}.item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
}
$fileds = "{$this->t1}.id,{$this->t1}.name,{$this->t1}.mobile,{$this->t1}.brand_id,{$this->t1}.s_id,{$this->t1}.v_id,
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,
{$this->t1}.biz_id,{$this->t1}.bill_time,{$this->t1}.customer_id,{$this->t1}.owner_name,{$this->t1}.owner_mobile,{$this->t1}.main_type,{$this->t1}.info_json,
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time";
if(strlen($params['status_pid'])){
$where["{$this->t1}.brand_id>"] = 0;
}
if (strlen($params['status_pid']) && $params['status'] == 1) { //付款-已下定
$where["{$this->t1}.status <> 2"] = null;
}
if ($params['status_pid'] == 4) { //交付需要开票后才显示
$where["{$this->t1}.id in (select o_id from lc_receiver_order_status where pid_status=3 and status=1)"] = null;
}
if (strlen($params['status_pid']) && $params['status_pid'] && $params['status_pid']!=21) {
$where["{$this->t1}.id>="] = Orders_v2_entity::V2_START_ID;
}
if (strlen($params['status_pid']) && !$params['status_pid']) { //付款列表 下定时间排序
$orderby = "{$this->t1}.order_time desc";
} elseif ($params['status_pid'] == 3) { // 开票列表 开票时间排序
$orderby = "{$this->t1}.bill_time desc";
} else {
$orderby = "{$this->t1}.c_time desc";
}
if (strlen($params['status_pid']) && $params['status'] && $params['status_pid']!=21) {
$where["{$this->t2}.pid_status"] = $params['status_pid'];
$up_key = $params['status'] + 1;
$where["{$this->t2}.status in ({$params['status']},{$up_key})"] = null;
$having = "total = 1";
if ($params['status_pid'] == 0 && $params['status'] == 1) {
$having = "total >= 1";
}
$count = $this->ci->mdOrders->selectOrders($where, '', '', '', 1, '', $having);
$rows = $this->ci->mdOrders->selectOrders($where, $orderby, $page, $size, '', $fileds, $having);
} else {
if (strlen($params['status'])) {
$where["id not in (select o_id from lc_receiver_order_status where pid_status={$params['status_pid']} and status=1)"] = null;
}
if ($params['status_pid'] == 3) { //开票
if (strlen($params['status'])) { //待开票
$where['id in (select o_id from lc_receiver_order_status where pid_status=0 and status=2)'] = null;
} else { //全部
$where['id in (select o_id from lc_receiver_order_status where (pid_status=0 and status=2) or (pid_status=3 and status=1))'] = null;
}
}
$params['status_pid'] == 21 && $where['status'] = 2; //退款
$count = $this->ci->mdOrders->count($where);
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size, $fileds);
}
$lists = [];
if ($count) {
//商品vin
$str_item_ids = implode(',', array_unique(array_column($rows, 'item_id')));
!$str_item_ids && $str_item_ids = 0;
$items = $this->ci->mdItems->map('id', 'vin', array("id in({$str_item_ids})" => null));
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'customer_id')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
$bizs = $this->ci->biz_model->map('id', 'biz_name', array("id in({$str_biz_ids})" => null));
//品牌车型
$brand_arr = array_unique(array_column($rows, 'brand_id'));
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
$series_arr = array_unique(array_column($rows, 's_id'));
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
//获取属性
$v_arr = array_unique(array_column($rows, 'v_id'));
$cor_arr = array_unique(array_column($rows, 'cor_id'));
$incor_arr = array_unique(array_column($rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$money_json = json_decode($val['money_json'], true);
$info_json = json_decode($val['info_json'], true);
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$fields['o_id'] = $val['id'];
if (Orders_v2_entity::V2_START_ID < $val['id']) {
if ($val['main_type']) {
$name = $info_json['c_company'];
$mobile = $val['mobile'];
} else {
$name = $val['owner_name'];
$mobile = $val['owner_mobile'];
}
$open_url = '/receiver/orderv2/orders/get?id=';
$fields['name'] = $size > 1000 ? $name
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
} else {
$open_url = '/receiver/orders/get?id=';
$mobile = $val['mobile'];
$o_tp = '(旧订单)';
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $val['name'] . $o_tp . '<br>' . $val['mobile'] . '</a>';
}
$fields['mobile'] = $mobile;
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = $this->paywayAry[$val['payway']]."<br>".number_format($money_json['price_car'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
if (strlen($params['status_pid']) && $params['status_pid'] != 5 && $val['status'] != 2) {
$fields['status_name'] = $this->ci->orders_status_entity->last_status_cn($val['id'], $params['status_pid']);
} else {
$fields['status_name'] = $order_status_cn[$val['status']];
}
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$of_title = '-';
$of_id = $customers[$val['customer_id']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['customer_id']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '';
$fields['bill_time'] = $val['bill_time'] != '0000-00-00 00:00:00' ? $val['bill_time'] : '';
$fields['over_time'] = $val['over_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($val['over_time'])) : '';
$fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $_title : $_title . '列表';
$view_type != 'orders' && $status_arr = [];
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => $view, 'view_type' => $view_type, '_title' => $_title);
}
/**
* Notes:意向金订单
* @param array $params
* @return array
*/
private function inten_orders($params = array())
{
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$status_arr = $this->ci->receiver_order_status_model->statusAry();
$view_type = 'orders';
$where = [
"status" => 0,
"id>=" => 10000,
"brand_id" => 0
];
$_title = '全部订单';
$view = 'receiver/orderv2/lists';
$params['status_pid'] == 1 && $where["payway"] = 0;
if (is_product()) {
$where["biz_id<>"] = 1;
}
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["biz_id in ($biz_ids)"] = null;
}
if ($params['biz_type']) {
$where["biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ' and status=1)'] = null;
}
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where["customer_id in (select id from lc_receiver_customers where " . $where_c . ')'] = null;
}
if ($params['qdjl_id']) {//渠道经理
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
if ($params['title']) {
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
//创建时间
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
if ($c_time[0]) {
$where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
}
if ($c_time[1]) {
$where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
}
//销售员筛选
if ($params['admin_id']) {
$where["sale_id"] = $params['admin_id'];
} else {
if ($params['biz_id_admin']) {//指定店铺所有销售员
$where["biz_id"] = $params['biz_id_admin'];
} else {
//指定城市的所有门店
$where_biz = array();
if ($params['county_id_admin']) {
$where_biz['county_id'] = $params['county_id_admin'];
} else if ($params['city_id_admin']) {
$where_biz['city_id'] = $params['city_id_admin'];
}
if ($where_biz) {
$where_biz['status>-1'] = null;
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($rows_biz) {
$str_ids = implode(',', array_column($rows_biz, 'id'));
$where["biz_id in({$str_ids})"] = null;
} else {
$where["biz_id"] = -1;
}
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
$where["id in(select o_id from lc_app_liche_orders where type=4 and status=1 and o_id>=10000)"] = null;
$fileds = "id,name,mobile,brand_id,s_id,v_id,
cor_id,incor_id,money_json,payway,status,c_time,
biz_id,bill_time,customer_id,owner_name,owner_mobile,main_type,info_json,
order_time,bill_time,item_id,over_time";
$count = $this->ci->mdOrders->count($where);
$rows = $this->ci->mdOrders->select($where, 'c_time desc', $page, $size, $fileds);
$lists = [];
if ($count) {
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'customer_id')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
$bizs = $this->ci->biz_model->map('id', 'biz_name', array("id in({$str_biz_ids})" => null));
foreach ($rows as $key => $val) {
$money_json = json_decode($val['money_json'], true);
$info_json = json_decode($val['info_json'], true);
$fields = array();
$fields['o_id'] = $val['id'];
if ($val['main_type']) {
$name = $info_json['c_company'];
$mobile = $val['mobile'];
} else {
$name = $val['owner_name'];
$mobile = $val['owner_mobile'];
}
$open_url = '/receiver/orderv2/orders/get?id=';
$fields['name'] = $size > 1000 ? $name
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
$fields['mobile'] = $mobile;
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$of_title = '-';
$of_id = $customers[$val['customer_id']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['customer_id']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$lists[] = $fields;
}
}
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$_title = $size > 1000 ? $_title : $_title . '列表';
$view_type != 'orders' && $status_arr = [];
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
, 'searchTpAry' => $this->searchTpAry, 'view' => $view, 'view_type' => $view_type, '_title' => $_title);
}
/**
* Notes:获取字段
* Created on: 2021/10/29 15:38
* Created by: dengbw
* @param $status_pid
* @param int $export
* @return array
*/
public function get_fields($status_pid, $export = 0)
{
$fields1 = $fields2 = [];
if ($export) {
$fields1['name'] = ['title' => '客户姓名'];
$fields1['mobile'] = ['title' => '客户电话'];
} else {
$fields1['name'] = ['title' => '客户', 'width' => '14%'];
}
if (!strlen($status_pid)) {
$fields2 = [
'car_name' => ['title' => '车辆', 'width' => '27%'], 'biz_name' => ['title' => '门店', 'width' => '12%'],
'price' => ['title' => '最终售价', 'width' => '9%'],
// 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'], 'status_name' => ['title' => '状态', 'width' => '9%'],
'c_time' => ['title' => '订单时间', 'width' => '9%'
]
];
} elseif ($status_pid == 3) {
$fields2 = [
'car_name' => ['title' => '车辆', 'width' => '27%'], 'biz_name' => ['title' => '门店', 'width' => '12%'],
'price' => ['title' => '最终售价', 'width' => '9%'],
// 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'], 'status_name' => ['title' => '状态', 'width' => '9%'],
'bill_time' => ['title' => '开票时间', 'width' => '9%']
];
} else {
$fields2 = [
'car_name' => ['title' => '车辆', 'width' => '27%'], 'biz_name' => ['title' => '门店', 'width' => '12%'],
'price' => ['title' => '最终售价', 'width' => '9%'],
// 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'], 'status_name' => ['title' => '状态', 'width' => '9%'],
'over_time' => ['title' => '交付截止', 'width' => '9%'],'order_time' => ['title' => '下定时间', 'width' => '9%']
];
}
$fields = array_merge($fields1, $fields2);
if ($export) {
$fields['vin'] = ['title' => 'vin码'];
}
return $fields;
}
}
?>
+1 -207
View File
@@ -17,18 +17,6 @@
<link rel="stylesheet" type="text/css" href="/static/css/appitem/hd.css?v=1581252500">
<form id="vue-edit" class="am-form am-form-horizontal" data-auto="true" action="/app/appusual/config/edit" method="post"
style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">是否开启店铺自定义分类:</label>
<div class="am-para-input">
<input type="checkbox" class="mui-switch mui-switch-anim" true-value="1" false-value="0" v-model="info.biz_cate" />
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">是否开通卡功能:</label>
<div class="am-para-input">
<input type="checkbox" class="mui-switch mui-switch-anim" true-value="1" false-value="0" v-model="info.vipcard" />
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">小程序发布设置:</label>
<div class="am-para-input">
@@ -36,161 +24,11 @@
<span class="note-text va-mid">(小程序发布审核时开启,可以隐藏一些敏感内容)</span>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">可使用权益类型:</label>
<div class="am-para-input">
<div class="am-g">
<label class="mr10" style="margin-top: 7px" v-for="(tv, tk) in type_arr">
<input type="checkbox" :value="tk" v-model="info.rights"/>{{tv}}
</label>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">可使用电子券类型:</label>
<div class="am-para-input">
<div class="am-g">
<label class="mr10" style="margin-top: 7px">
<input type="checkbox" value="1" v-model="info.coupons"/>erp电子券
</label>
<label class="mr10" style="margin-top: 7px">
<input type="checkbox" value="2" v-model="info.coupons"/>线下买单抵用券
</label>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">可用红包类型:</label>
<div class="am-para-input">
<div class="am-g">
<label class="mr10" style="margin-top: 7px">
<input type="checkbox" value="3" v-model="info.rpackets"/>线上红包
</label>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">可使用内容功能:</label>
<div class="am-para-input">
<div class="am-g">
<div class="am-g">
<label class="mr10" style="margin-top: 7px">
<input disabled type="checkbox" name="func[]" value="1"/>好评
</label>
<label class="mr10" style="margin-top: 7px">
<input disabled type="checkbox" name="func[]" value="2"/>文章
</label>
<label class="mr10" style="margin-top: 7px">
<input disabled type="checkbox" name="func[]" value="3"/>活动
</label>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">是否开启电商:</label>
<div class="am-para-input">
<input type="checkbox" name="ebiz" class="mui-switch mui-switch-anim" true-value="1" false-value="0" v-model="info.ebiz"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">是否开启分销锁粉:</label>
<div class="am-para-input">
<input type="checkbox" name="lock_fans" class="mui-switch mui-switch-anim" true-value="1" false-value="0" v-model="info.lock_fans" />
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">系统客服:</label>
<div class="am-para-input">
<a class="am-btn am-btn-primary" style="margin-top: 5px;"
:data-modal="'/app/app/get_servicer?type=0&app_id='+info.id"
:data-title="info.name+'客服设置'">客服设置</a>
</div>
</div>
<div class="am-form-group" v-if="14==info.id">
<label class="am-para-label label-width">热门搜索设置:</label>
<div class="am-para-input input-left">
<div class="am-form-inline">
<button type="button" class="am-btn am-btn-default am-btn-sm" @click="word_modal()">添加热词</button>
<span class="f12 clr999 lh-default ml5">热门搜索,已加<strong class="text-danger"
v-if="info.hotword">{{info.hotword.length}}</strong></span>
</div>
<div class="label-group-wrap label-group-sortable">
<draggable class="app-simulator-inner" v-model="info.hotword" group="info.hotword"
@start="drag=true" @end="drag=false" @sort="sort">
<div class="label-group" v-for="(v,i) in info.hotword">
<span class="label label-default sort-shop-list" :data-id="i" :data-name="v"
:data-sort="v">{{v}}</span>
<a href="javascript:void(0);" @click="rm_item(i, 'word',v)" class="label label-default"><i
class="fa fa-remove del_word"></i></a>
</div>
</draggable>
</div>
</div>
</div>
<div class="am-form-group mb20">
<label class="am-para-label">开通城市:</label>
<div class="am-para-input">
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>城市ID</span></th>
<th width="10%"><span>首字母</span></th>
<th width="20%"><span>城市名称</span></th>
<th width="20%"><span>状态</span></th>
<th width=""><span>操作</span></th>
</tr>
</thead>
<tbody>
<tr v-for="(v,k) in citys">
<td>{{v.city_id}}</td>
<td>{{v.firstchar}}</td>
<td>{{v.name}}</td>
<td>{{v.statusion}}</td>
<td>
<a v-if="1==v.status" data-ajax="post" data-action="/app/appusual/config/edit_city"
:data-params-id="info.id" :data-params-city="v.city_id"
data-params-status="0" class="am-btn am-btn-danger am-btn-xs">关闭</a>
<a v-else data-ajax="post" data-action="/app/appusual/config/edit_city"
:data-params-id="info.id" :data-params-city="v.city_id"
data-params-status="1" class="am-btn am-btn-primary am-btn-xs">开启</a>
<a v-if="1==v.default_city_id" data-ajax="post" data-action="/app/appusual/config/edit_city"
:data-params-id="v.id" :data-params-city="v.city_id"
data-params-type="1" data-params-status="0"
class="am-btn am-btn-danger am-btn-xs">取消默认</a>
<a v-else data-ajax="post" data-action="/app/appusual/config/edit_city"
:data-params-id="v.id" :data-params-city="v.city_id"
data-params-type="1" data-params-status="1"
class="am-btn am-btn-primary am-btn-xs">设为默认</a>
<a v-if="1==v.status&&13==v.id" href="javascript:;" :data-open="'app/xmfish/main/get_city?city_id='+v.city_id" class="c-btn am-btn am-btn-primary am-btn-xs">设置</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<button class="am-btn am-btn-success" type="button" @click="saveEdit">提交</button>
</div>
</div>
<div id="word-modal" style="display: none;">
<div class="modal-body">
<label class="am-para-label" style="margin-left: -60px;" >热搜词:</label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group" style="width: 75%">
<input type="text" class="hot_word" v-model="hot_word" placeholder="请输入热搜词">
</div>
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript">
var vue_obj;
@@ -200,22 +38,10 @@
el: '#vue-edit',
data: {
info:'',
type_arr:'',
coup_arr:'',
citys:'',
hot_word:''
},
mounted:function() {
var vm = this;
vm.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
vm.type_arr = <?=json_encode($type_arr, JSON_UNESCAPED_UNICODE)?>;
vm.coup_arr = <?=json_encode($coup_arr, JSON_UNESCAPED_UNICODE)?>;
vm.citys = <?=json_encode($citys, JSON_UNESCAPED_UNICODE)?>;
if(vm.info.rights == undefined){vm.info.rights=[];}
if(vm.info.coupons == undefined){vm.info.coupons=[];}
if(vm.info.rpackets == undefined){vm.info.rpackets=[];}
if(vm.info.hotword == undefined){vm.info.hotword=[];}
console.log(vm.info);
},
computed: {},
created: function () {
@@ -223,38 +49,6 @@
updated: function () {
},
methods: {
word_modal:function(){
var vm = this;
layer.open({
type: 1,
area: ['50%', '30%'], //宽高
content: $('#word-modal'),
title: '热词搜索',
shade: false,
btn: ['确定添加'],
yes: function (index) {
if(vm.hot_word){
var sear=new RegExp(vm.hot_word);
if(!sear.test(vm.info.hotword)){
vm.info.hotword.push(vm.hot_word);
vm.hot_word = '';
}else{
layer.msg("该热词已存在", {icon: 2});
}
}
layer.close(index);
}
});
},
rm_item:function(i, type, word){
var vm = this;
if (type == 'word'){
vm.info.hotword.splice(i,1);
}
},
sort:function(){
var vm = this;
},
saveEdit: function () {
if (loading) {
return;
@@ -297,4 +91,4 @@
}
});
});
</script>
</script>
+23 -1
View File
@@ -26,6 +26,7 @@
<tr>
<th width="10%"><span>ID</span></th>
<th width="30%"><span>小程序名称</span></th>
<th width="10%"><span>发布审核</span></th>
<th width="20%"><span>创建时间</span></th>
<th width="20%"><span>操作</span></th>
</tr>
@@ -35,6 +36,9 @@
<tr>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['id']?></td>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['name']?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<input id="publish" type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$item['publish']?'checked':''?> onchange="set_publish(this,<?=$item['id']?>)"/>
</td>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['c_time']?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<a class="am-btn am-btn-primary am-btn-xs mr10" href="javascript:void(0);" data-modal="/app/app/get?id=<?=$item['id']?>">详情</a>
@@ -52,4 +56,22 @@
</div>
<script>
</script>
function set_publish(obj,id){
var value = '';
if($(obj).get(0).checked) {
value = 1;
}else{
value = 0;
}
var data = {'id':id,'value':value};
$.post('/app/app/edit_publish',data,function(result){
if(result.code){
layer.msg(result.msg, {time: 2000,icon:1 }, function () {
$.form.reload();
});
}else{
layer.msg(result.msg,{icon:2});
}
},'json')
}
</script>
@@ -43,6 +43,7 @@
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
+229
View File
@@ -0,0 +1,229 @@
<form id="vue-app" class="am-form am-form-horizontal ml20" action="/app/appusual/umajia/edit"
data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<span class="am-para-label">用户信息:</span>
<div class="am-para-input" style="width: 50%">
<span>{{info.nickname}} {{info.mobile}}</span>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">马甲信息:</label>
<div class="am-para-input">
<span class="mr10">{{info.majia.nickname}} {{info.majia.mobile}}</span>
<button class="am-btn am-btn-success" type="button" @click="userModal">选择马甲</button>
</div>
</div>
<div class="am-form-group">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="button" @click='saveEdit();'>保存</button>
</div>
</div>
<div id="user-modal" style="display: none;">
<div class="modal-body">
<table class="table table-middle" style="margin-bottom: 0px;">
<colgroup>
<col width="35%"/>
<col width="35%"/>
<col width="30%"/>
</colgroup>
<thead>
<tr>
<th class="text-left">用户列表</th>
<th class="text-right">
<form class="form-inline">
<div class="form-group" style="margin-bottom: 0px;">
<label class="sr-only" for="search">搜用户</label>
<div class="input-group input-group-sm">
<input type="text" class="form-control" style="font-size: 1.2rem;"
v-model='keyword' placeholder="客服昵称或手机号">
<div class="input-group-btn">
<button type="button" @click='getUsers(1);' class="btn btn-default">
</button>
</div>
</div>
</div>
</form>
</th>
</tr>
</thead>
</table>
<table class="table table-middle" style="margin-bottom: 0px;border-top: 0px;">
<tbody>
<tr v-for="(b,i) in users">
<td>{{b.nickname}}{{b.mobile}}</td>
<td class="text-right">
<a v-if="b.is_checked==0" href="javascript:void(0);" @click="setUser(i,1)"
class="btn btn-primary btn-sm">选择</a>
<a v-else-if="b.is_checked==1" href="javascript:void(0);" @click="setUser(i,0)"
class="btn btn-default btn-sm">移除</a>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<span class="pull-left text-muted">{{userPage.page}}(每页{{userPage.pageLimit}},{{userPage.pageCount}})</span>
<nav class="pull-right" aria-label="Page navigation">
<ul class="pagination pagination-sm">
<li v-if="userPage.page > 1">
<a href="javascript:void(0);" @click="beforeUserPage();" aria-label="上一页">
<span class="glyphicon glyphicon-menu-left"></span>
</a>
</li>
<li v-if="userPage.hasNext">
<a href="javascript:void(0);" @click="afterUserPage();" aria-label="下一页">
<span class="glyphicon glyphicon-menu-right"></span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</form>
<script>
var vue_app;
var loading = false;
$(function(){
vue_app = new Vue({
el: '#vue-app',
data: {
info:<?=$info ? json_encode($info, JSON_UNESCAPED_UNICODE) : '{}'?>,
users: [],
max_num: 0,
keyword: '',
userPage:[],
app_id:'<?=$app_id?>'
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
userModal: function (index) {
var vm = this;
vm.keyword = vm.info.majia.nickname;
vm.getUsers(1);
layer.open({
type: 1,
area: '500px', //宽高
content: $('#user-modal'),
title: '选取用户',
shade: false,
btn: ['选好了'],
yes: function (index) {
layer.close(index);
}
});
},
getUsers: function (page, size=5) {
var vm = this;
$.ajax({
url: '/common/appusers',
type: 'get',
dataType: 'json',
data: {
page: page,
size: size,
app_id:vm.app_id,
keyword: vm.keyword
},
success: function (re) {
if(re.data.total > 0){
for(var i in re.data.list){
if (vm.info.majia.uid == re.data.list[i].id) {
re.data.list[i].is_checked = 1;
} else {
re.data.list[i].is_checked = 0;
}
}
}
vm.users = re.data.list;
max_page = Math.ceil(re.data.total/size);
vm.userPage = {page:page, pageLimit:size, pageCount:re.data.total, hasNext: page <max_page ? 1 : 0};
}
});
},
setUser: function (index, checked) {
//设置门店是否选中
var vm = this;
vm.removeUser();
if (checked == 1) {
vm.users[index]['is_checked'] = checked;
vm.info.majia.uid = vm.users[index]['id'];
vm.info.majia.nickname = vm.users[index]['nickname'];
vm.info.majia.mobile = vm.users[index]['mobile'];
}
},
removeUser: function (index) {
var vm = this;
for (var i = 0; i < vm.users.length; i++) {
vm.users[i]['is_checked'] = 0;
}
vm.info.majia = {};
},
beforeUserPage: function () {
var vm = this;
if (vm.userPage.page == 1) {
layer.msg("已经是第一页了");
return;
}
vm.userPage.page--;
vm.getUsers(vm.userPage.page);
},
afterUserPage: function () {
var vm = this;
if (vm.userPage.page == vm.userPage.pageCount) {
layer.msg("已经是末页了");
return;
}
vm.userPage.page++;
vm.getUsers(vm.userPage.page);
},
saveEdit: function () {
if (loading) {
return;
}
var vm = this;
loading = true;
$.ajax({
url: '/app/appusual/umajia/edit',
type: 'post',
dataType: 'json',
data: {
info: vm.info,
app_id:vm.app_id
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = false;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
layer.closeAll();
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
}
});
}
}
});
});
</script>
+161
View File
@@ -0,0 +1,161 @@
<div class="am-g">
<div class="col-sm-12">
<?php foreach ($menuAry as $key => $value) { ?>
<a href="javascript:void(0)">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
<?= $value['title'] ?>
</div>
<div class="text-center" style="padding-top: 3px;">
<span><?= $value['value'] ?></span> <?= $value['tag'] ?>
</div>
</div>
</div>
</a>
<? } ?>
</div>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/bobing/member/index">
<input type="hidden" id="credit_sort" name="credit_sort" value="<?= $params['credit_sort'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">会员名称:</label>
<div class="am-para-inline w150">
<input type="text" name="name" value="<?= $params['name'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">手机号码:</label>
<div class="am-para-inline w150">
<input type="text" name="mobile" value="<?= $params['mobile'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">开桌:</label>
<div class="am-para-inline w100">
<select name="if_kz">
<option value="">全部</option>
<?php foreach ($ifkzAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['if_kz'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">购车金:</label>
<div class="am-para-inline w100">
<select name="car_gold">
<option value="">全部</option>
<?php foreach ($carGoldAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['car_gold'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">企业微信:</label>
<div class="am-para-inline w100">
<select name="wxqy">
<option value="">全部</option>
<?php foreach ($wxqyAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['wxqy'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>用户名称</span></th>
<th width="10%"><span>手机号码</span></th>
<th width="10%"><span>积分 <a href="javascript:" id="id_credit_sort"><i class="fa fa-sort"></i>
<? if ($params['credit_sort'] == 1) { ?>
<i class="fa fa-arrow-down"></i>
<? } else if ($params['credit_sort'] == 2) { ?>
<i class="fa fa-arrow-up"></i>
<? } ?>
</a></span></th>
<th width="15%"><span>博饼+企微+排名=总购车金</span></th>
<th width="10%"><span>开桌</span></th>
<th width="10%"><span>企业微信</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['nickname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['credit'] ?></td>
<td><?= $v['car_gold'] ?></td>
<td><?= $v['if_kz'] ?></td>
<td><?= $v['wxqy'] ?></td>
</tr>
<tr>
<td colspan="6" class="align-r">
<div class="row">
<div class="col-md-6 align-l">
</div>
<div class="col-md-6 align-r">
<a href="javascript:void(0);"
data-open="/app/bobing/member/lists_day?uid=<?= $v['uid'] ?>"
class="am-btn am-btn-primary am-btn-xs">每日博饼</a>
<a href="javascript:void(0);"
data-open="/app/bobing/member/lists_logs?uid=<?= $v['uid'] ?>"
class="am-btn am-btn-primary am-btn-xs">博饼记录</a>
</div>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
$('#id_credit_sort').on('click', function () {
var credit_sort = $('#credit_sort').val();
if (credit_sort == -1) {
credit_sort = 1;
} else if (credit_sort == 1) {
credit_sort = 2;
} else if (credit_sort == 2) {
credit_sort = -1;
}
$('#credit_sort').val(credit_sort);
var $form = $('#vue-app');
$form.submit();
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.tab-active {
background-color: #5cb85c;
color: #fff;
}
.my-panel span {
font-size: 20px;
}
</style>
@@ -0,0 +1,28 @@
<div class="coms-table-wrap mt10">
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>博饼日期</span></th>
<th width="10%"><span>积分</span></th>
<th width="10%"><span>是否中奖</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['bo_date'] ?></td>
<td><?= $v['credit'] ?></td>
<td><?= $v['lottery'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
@@ -0,0 +1,90 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/bobing/member/lists_logs">
<input name="uid" type="hidden" value="<?= $params['uid'] ?>"/>
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100">博饼日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-bo_date" name="bo_date" type="text" value="<?= $params['bo_date'] ?>"
placeholder="博饼日期范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
</div>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>骰子点数</span></th>
<th width="10%"><span>级别</span></th>
<th width="10%"><span>积分</span></th>
<th width="10%"><span>购车金</span></th>
<th width="10%"><span>红包</span></th>
<th width="15%"><span>类型</span></th>
<th width="10%"><span>博饼日期</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['dices'] ?></td>
<td><?= $v['level_name'] ?></td>
<td><?= $v['credit'] ?></td>
<td><?= $v['car_gold'] ?></td>
<td><?= $v['hong_bao'] ?></td>
<td><?= $v['type_name'] ?></td>
<td><?= $v['bo_date'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-bo_date', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
}
$('#id-bo_date').val(date);
});
});
</script>
+91
View File
@@ -0,0 +1,91 @@
<div class="coms-table-wrap">
<!-- no-border 去掉头部就有边控了-->
<div class="coms-table-hd clearfix no-border">
<form action="/app/liche/cash/lists" class="form-search" onsubmit="return false">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label">状态:</label>
<div class="am-para-inline w150">
<select name="status" v-model="status">
<option value="">请选择</option>
<option v-for="(value,key) in status_arr" :value="key">{{value}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group fl ">
<button type="submit" class="am-btn ml20 am-btn-sm am-btn-success w100">搜索</button>
</div>
<div class="am-form-group fr" style="font-size: 15px;padding-right: 20px;padding-top: 6px;">
共有<?= $pager['total'] ?>条数据
</div>
</form>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%"><span>ID</span></th>
<th width="10%"><span>用户</span></th>
<th width="10%"><span>提现金额</span></th>
<th width="20%"><span>支付宝</span></th>
<th width="5%"><span>状态</span></th>
<th width="20%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="value in lists">
<tr>
<td>{{value.id}}</td>
<td>{{value.nickname}}</td>
<td>{{value.money}}</td>
<td>
姓名:{{value.ali_name}}<br>
支付宝账号:{{value.ali_account}}
</td>
<td>{{value.status_cn}}</td>
<td>{{value.c_time}}</td>
</tr>
<tr v-if="value.status==0">
<td colspan="6" class="align-r">
<input data-ajax="post" data-action="/app/liche/cash/edit" :data-params-id="value.id" type="button" class="am-btn am-btn-xs am-btn-primary" value="确认转账"/>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
<script type="text/javascript">
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#datepicker1'
});
laydate.render({
elem: '#datepicker2'
});
});
var vm = new Vue({
el: '.coms-table-wrap',
data: {
lists: [],
status: '<?=strlen($params['status'])?$params['status']:''?>',
status_arr : <?=json_encode($status_arr,JSON_UNESCAPED_UNICODE)?>,
},
mounted() {
var that = this;
that.lists = <?=json_encode($lists,JSON_UNESCAPED_UNICODE)?>;
},
created: function () {
},
methods: {}
})
</script>
+79 -19
View File
@@ -34,7 +34,7 @@
</div>
<div class="am-form-group">
<label class="am-para-label">推送位置:</label>
<div class="am-para-inline wp60" style="width : 20%">
<div class="am-para-inline wp60" style="width:20%">
<select name="position" v-model="info.position">
<option value="">请选择</option>
<template v-for="(v,i) in positions">
@@ -43,10 +43,40 @@
</select>
</div>
</div>
<div class="am-form-group" v-if="info.position==2">
<label class="am-para-label">类型</label>
<div class="am-para-input" style="margin-top: 5px;">
<span class="mr10">车型<input type="radio" name="type" v-model='info.type' value="2" @change="change_type"/></span>
<div class="am-form-group" style="margin-bottom: 0" v-if="info.position == 8">
<label class="am-para-label">二维码图片</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm" data-file="1"
data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu" data-field="qrcode"><i
class="am-icon-cloud-upload"></i> 选择要上传的文件
</button>
<input id="qrcode" type="hidden" name="qrcode" value="<?=$info['qrcode']?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src="<?=$info['qrcode']?build_qiniu_image_url($info['qrcode']):''?>"/>
</div>
</div>
</div>
<div class="am-form-group" v-if="info.position == 2">
<label class="am-para-label">线索来源:</label>
<div class="am-para-input wp60">
<select name="cfrom_id" v-model="info.cfrom_id" style="width:150px;display:inline" @change="getCfroms()">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
<select name="cfrom_id2" v-model="info.cfrom_id2" style="width:150px;display:inline">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group" v-if="info.position >2 && info.position<8">
<label class="am-para-label">链接类型:</label>
<div class="am-para-input pt5">
<input type="radio" name="type" v-model="info.type" value="1"/>小程序
</div>
</div>
<div class="am-form-group">
@@ -55,9 +85,33 @@
<input type="text" placeholder="输入链接" v-model="info.link" name="link"/>
</div>
</div>
<div v-if="info.type == 2">
<div class="am-form-group" v-if="info.position == 2">
<label class="am-para-label">按钮颜色:</label>
<div class="am-para-input pt5">
<input type="radio" name="btn_type" v-model="info.btn_type" value="1"/>深色
<input type="radio" name="btn_type" v-model="info.btn_type" value="2"/>浅色
</div>
</div>
<div v-if="info.position == 2">
<v-cars-select :target_id.sync="info.target_id" :app_id="app_id"></v-cars-select>
</div>
<div class="am-form-group" style="margin-bottom: 0" v-if="info.position == 2">
<label class="am-para-label">背景图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm" data-file="1"
data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu" data-field="bg_img"><i
class="am-icon-cloud-upload"></i> 选择图片
</button>
<input id="bg-img" type="hidden" name="bg_img" value="<?=$info['bg_img']?>" class="layui-input">
<?if($info['bg_img_src']){?>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src="<?=$info['bg_img_src']?>"/>
<?} else{?>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src=""/>
<?}?>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">简介:</label>
<div class="am-para-input wp60">
@@ -95,10 +149,10 @@
<table width="100%">
<tr>
<td width="35%" style="font-weight: bold;padding-left: 8px;">车型</td>
<td width="35%" style="padding-right: 8px;"><label class="sr-only" for="search">车系</label>
<td width="35%" style="padding-right: 8px;"><label class="sr-only" for="search">品牌</label>
<div class="input-group input-group-sm">
<input type="text" class="form-control" style="font-size: 1.2rem;font-weight: bold;"
v-model='itemsTitle' placeholder="车系">
v-model='itemsTitle' placeholder="品牌">
<div class="input-group-btn">
<button type="button" @click='getItems(1);' class="btn btn-default"></button>
</div>
@@ -110,18 +164,15 @@
<table class="table table-middle">
<colgroup>
<col width="50%"/>
<col width="30%"/>
<col width="20%"/>
<col width="50%"/>
</colgroup>
<tbody>
<tr>
<th>车系</th>
<th>品牌</th>
<th>操作</th>
</tr>
<tr v-for="(b,i) in itemsList">
<td>{{b.name}}</td>
<td>{{b.b_name}}</td>
<td>
<a v-if="b.is_checked==0" href="javascript:void(0);" @click="setItems(i,1)"
class="btn btn-primary btn-sm">选择</a>
@@ -256,7 +307,7 @@
}
console.dir(select_list)
$.ajax({
url: '/common/cars',
url: '/common/brands',
type: 'post',
dataType: 'json',
data: {
@@ -280,7 +331,7 @@
vm.itemsList[index]['is_checked'] = checked;
var _items = {
id: vm.itemsList[index]['id'],
title: vm.itemsList[index]['b_name']+vm.itemsList[index]['name'],
title: vm.itemsList[index]['name'],
img : '/img/visits/add.jpg'
};
vm.select = _items;
@@ -302,8 +353,7 @@
var vm = this;
if (vm.itemsPage.page == 1) {
layer.msg("已经是第一页了");
return;
}
return; }
vm.itemsPage.page--;
vm.getItems(vm.itemsPage.page);
},
@@ -323,6 +373,8 @@
areas:[],
covers:[],
app_id:0,
cfroms:[],
cfroms2:[],
},
mounted: function(){
var that = this;
@@ -331,11 +383,17 @@
that.areas = <?=json_encode($area_arr, JSON_UNESCAPED_UNICODE)?>;
that.covers = <?=json_encode($covers, JSON_UNESCAPED_UNICODE)?>;
that.app_id = <?=$app_id?>;
that.cfroms = <?=$cfroms ? json_encode($cfroms,JSON_UNESCAPED_UNICODE): []?>;
that.getCfroms()
},
methods: {
change_type: function () {
var vm = this;
vm.info.target_id = 0;
getCfroms: function(){
var that = this
if(that.info.cfrom_id>0){
$.get('/app/liche/cms/get_cfroms',{'id':that.info.cfrom_id},function(result){
that.cfroms2 = result.data.data
});
}
},
saveEdit: function () {
if (loading) {
@@ -346,6 +404,8 @@
vm.info.cover = $('#cover').val();
vm.info.s_time = $('#s-time').val();
vm.info.e_time = $('#e-time').val();
vm.info.bg_img = $('#bg-img').val();
vm.info.qrcode = $('#qrcode').val();
vm.info.content = editor.getData();
$.ajax({
+5 -1
View File
@@ -57,6 +57,7 @@
<th width="8%"><span>ID</span></th>
<th width="20%"><span>标题</span></th>
<th width="20%"><span>位置</span></th>
<th width="5%"><span>排序值</span></th>
<th width="20%"><span>开始时间</span></th>
<th width="20%"><span>结束时间</span></th>
<th width="15%"><span>状态</span></th>
@@ -69,7 +70,8 @@
<!-- <td rowspan="2"><input class="cms-ids" :value="value.id" type="checkbox" /></td>-->
<td>{{value.id}}</td>
<td>{{value.title}}</td>
<td>{{value.position}}</td>
<td>{{value.position_name}}</td>
<td>{{value.sort}}</td>
<td>{{value.s_time}}</td>
<td>{{value.e_time}}</td>
<td v-if="value.status == '0'">下架</td>
@@ -77,6 +79,8 @@
</tr>
<tr>
<td colspan="7" class="align-r">
<input type="button" class="am-btn am-btn-xs am-btn-primary"
:data-modal="'/app/liche/cms/get_share_link?&id='+value.id" value="查看二维码" v-if="value.position==8"/>
<input type="button" class="am-btn am-btn-xs am-btn-primary"
:data-open="'/app/liche/cms/get?&id='+value.id" value="修改"/>
<input v-if="value.status == '0'" type="button" class="am-btn am-btn-xs am-btn-danger"
+122
View File
@@ -0,0 +1,122 @@
<div class="am-g">
<div class="col-sm-12">
<?php foreach ($ary['menuAry'] as $key => $value) { ?>
<a href="javascript:void(0)">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
<?= $value['title'] ?>
</div>
<div class="text-center" style="padding-top: 3px;">
<span><?= $value['value'] ?></span> <?= $value['tag'] ?>
</div>
</div>
</div>
</a>
<? } ?>
</div>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/liche/luckybag">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">用户名称:</label>
<div class="am-para-inline w150">
<input type="text" name="name" value="<?= $params['name'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">手机号码:</label>
<div class="am-para-inline w150">
<input type="text" name="mobile" value="<?= $params['mobile'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">中奖:</label>
<div class="am-para-inline w100">
<select name="lottery">
<option value="">全部</option>
<?php foreach ($ary['lotteryAry'] as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['lottery'] ? 'selected' : '' ?>><?= $value['title'] ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">入门礼包:</label>
<div class="am-para-inline w100">
<select name="gift_bag">
<option value="">全部</option>
<?php foreach ($ary['giftBagAry'] as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['gift_bag'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>用户名称</span></th>
<th width="10%"><span>手机号码</span></th>
<th width="10%"><span>中奖</th>
<th width="15%"><span>入门礼包</span></th>
<th width="10%"><span>助力用户</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<? foreach ($lists as $v) { ?>
<tr>
<td><?= $v['nickname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['lottery'] ?></td>
<td>
<? if ($v['gift_bag']) { ?>
已领取
<? } else { ?>
<a href="javascript:void(0)" data-ajax="post"
data-action="/app/liche/luckybag/edit_gift_bag"
data-params-uid="<?= $v['uid'] ?>" class="am-btn am-btn-xs am-btn-danger">设为已领取</a>
<? } ?>
</td>
<td><a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/liche/luckybag/lists_log?uid=<?= $v['uid'] ?>">
<?= $v['zhu_li_count'] ?>人</a>
</td>
<td><?= $v['c_time'] ?></td>
</tr>
<? } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.tab-active {
background-color: #5cb85c;
color: #fff;
}
.my-panel span {
font-size: 20px;
}
</style>
@@ -0,0 +1,28 @@
<div class="coms-table-wrap mt10">
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>用户名称</span></th>
<th width="10%"><span>手机号码</span></th>
<th width="10%"><span>助力时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['nickname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
+37 -10
View File
@@ -20,13 +20,17 @@
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>ID</span></th>
<th width="20%"><span>用户名称</span></th>
<th width="20%"><span>手机号码</span></th>
<th width="5%"><span>是否分销</span></th>
<th width="5%"><span>分销管理</span></th>
<th width="20%"><span>创建时间</span></th>
<th>操作</th>
</tr>
</thead>
<tbody>
@@ -35,7 +39,22 @@
<td><?= $v['id'] ?></td>
<td><?= $v['nickname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td>
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$v['dealer']&&!$v['up_uid']?'checked':''?> onchange="set_publish(this,<?=$v['id']?>)"/>
</td>
<td>
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$v['manage']?'checked':''?> onchange="set_publish(this,<?=$v['id']?>,'manage')"/>
</td>
<td><?= date('Y-m-d H:i:s',$v['c_time']) ?></td>
<td>
<?if($v['umajia']){?>
<a class="am-btn am-btn-primary am-btn-xs" data-open="/app/appusual/umajia/get?uid=<?=$v['id']?>&app_id=<?=$app_id?>" data-title="编辑马甲">编辑马甲</a>
<a href="javascript:void(0)" data-ajax="post" data-action="/app/appusual/umajia/del?app_id=<?=$app_id?>"
data-params-uid="<?=$v['id']?>" class="am-btn am-btn-xs am-btn-danger">脱去马甲</a>
<?}elseif(isset($v['umajia'])){?>
<a class="am-btn am-btn-primary am-btn-xs" data-open="/app/appusual/umajia/get?uid=<?=$v['id']?>&app_id=<?=$app_id?>" data-title="披上马甲">披上马甲</a>
<?}?>
</td>
</tr>
<!--
<tr>
@@ -55,14 +74,22 @@
</div>
</div>
<script>
$('#bd-hd-city').change(function () {
var city = $(this).find('option:selected').text();
});
$('#majia').change(function () {
$('#vue-app').submit();
});
$('#dealer').change(function () {
$('#vue-app').submit();
});
function set_publish(obj,id,field='dealer'){
var value = '';
if($(obj).get(0).checked) {
value = 1;
}else{
value = 0;
}
var data = {'id':id,[field]:value};
$.post('/app/liche/member/edit',data,function(result){
if(result.code){
layer.msg(result.msg, {time: 2000,icon:1 }, function () {
$.form.reload();
});
}else{
layer.msg(result.msg,{icon:2});
}
},'json')
}
</script>
+68
View File
@@ -0,0 +1,68 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/liche/order">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">手机号码:</label>
<div class="am-para-inline w150">
<input type="text" name="mobile" value="<?= $params['mobile'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width=""><span>订单金额</span></th>
<th width=""><span>实付金额</span></th>
<th width=""><span>收款公司</span></th>
<th width=""><span>描述</span></th>
<th width=""><span>订单类型</span></th>
<th width=""><span>支付状态</span></th>
<th width="">操作</th>
</tr>
</thead>
</table>
<?foreach($lists as $key=>$val){?>
<table class="am-table am-table-bordered" style="margin-top:10px">
<thead>
<tr>
<th colspan="7" class="align-l">
时间:<?=$val['c_time']?>&nbsp;&nbsp;订单号:<?=$val['sid']?>&nbsp;&nbsp;购车人:<?=$val['name']?>&nbsp;&nbsp;手机号:<?=$val['mobile']?>&nbsp;&nbsp;<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$val['o_id']?>">购车订单</a>
</th>
</tr>
</thead>
<tbody>
<?foreach($val['sub_lists'] as $item){?>
<tr>
<td width=""><?=$item['total_price']?></td>
<td width=""><?=$item['pay_price']?></td>
<td width=""><?=$item['company']?></td>
<td width=""><?=$item['descrip']?></td>
<td width=""><?=$item['type_cn']?></td>
<td width=""><?=$item['status'] ? '已支付':'未支付'?></td>
<td width="">
<?if(!$item['status']){?>
<button class="am-btn am-btn-primary am-btn-sm fl ml10" data-ajax="post" data-action="/app/liche/order/edit_pay" data-params-id="<?=$item['id']?>">确认线下收款</button>
<?}?>
</td>
</tr>
<?}?>
</tbody>
</table>
<?}?>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
</script>
+177
View File
@@ -0,0 +1,177 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/channel">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">姓名:</label>
<div class="am-para-inline w150">
<input type="text" name="uname" value="<?= $params['uname'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">手机号码:</label>
<div class="am-para-inline w150">
<input type="text" name="mobile" value="<?= $params['mobile'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>ID</span></th>
<th width="20%"><span>姓名</span></th>
<th width="20%"><span>手机号码</span></th>
<th width="20%"><span>门店数</span></th>
<th width="20%"><span>创建时间</span></th>
<th width="10%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['uname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['bizs'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><a data-open="/app/licheb/channel/lists_biz?uid=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">门店列表</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
cityAry: [],//城市
countyAry: [],//行政区
bizAry: [],
province_id: '350'
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.init_citys(vm.province_id);
},
methods: {
init_citys: function (province_id) {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: province_id,
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
get_bizs: function () {
var that = this;
if (that.params.city_id > 0 || that.params.county_id > 0) {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
province_id: that.province_id,
city_id: that.params.city_id,
county_id: that.params.county_id,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.bizAry = response.data.list;
if (that.params.biz_id > 0) {
var biz_id = '';
for (var i in that.bizAry) {
if (that.params.biz_id == that.bizAry[i].id) {
biz_id = that.params.biz_id;
break;
}
}
that.params.biz_id = biz_id;
}
}
}
});
} else {
that.bizAry = [];
that.params.biz_id = '';
}
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
that.get_bizs();
},
'params.county_id': function (nv, ov) {
var that = this;
that.get_bizs();
}
}
});
$(function () {
<?php page_script($pager) ?>
});
$('#majia').change(function () {
$('#vue-app').submit();
});
$('#dealer').change(function () {
$('#vue-app').submit();
});
$('#export').click(function () {
window.location.href = '/app/licheb/channel/export';
});
</script>
@@ -0,0 +1,150 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/channel/lists_biz">
<input type="hidden" name="uid" value="<?= $params['uid'] ?>"/>
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-para-inline w200">
<input type="text" name="biz_name" value="<?= $params['biz_name'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">地区:</label>
<div class="am-form-group am-para-inline w150">
<select title="城市" name="city_id" v-model="params.city_id">
<option value="">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="行政区" name="county_id" v-model="params.county_id">
<option value="">行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="20%"><span>门店</span></th>
<th width="20%"><span>地区</span></th>
<th width="10%"><span>未见客户数</span></th>
<th width="10%"><span>到店客户数</span></th>
<th width="10%"><span>订单客户数</span></th>
<th width="10%"><span>战败客户数</span></th>
<th width="10%"><span>订单数</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['county_name'] ?></td>
<td><?= $v['wjkhs'] ?></td>
<td><?= $v['dtkhs'] ?></td>
<td><?= $v['ddkhs'] ?></td>
<td><?= $v['zbkhs'] ?></td>
<td><?= $v['orders'] ?></td>
<td><?= $v['days'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
cityAry: [],//城市
countyAry: [],//行政区
province_id: '350'
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.init_citys(vm.province_id);
},
methods: {
init_citys: function (province_id) {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: province_id,
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
}
}
});
$(function () {
<?php page_script($pager) ?>
});
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/app/licheb/channel/export?' + arr[1];
window.location.href = href;
});
</script>
+321 -9
View File
@@ -1,31 +1,343 @@
<form id="vue-app" class="am-form am-form-horizontal" action="/app/licheb/member/<?=$row['id'] ? 'edit' : 'add'?>" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<input type="hidden" name="id" v-model="info.id"/>
<form id="vue-edit" class="am-form am-form-horizontal" action="<?= $action ?>" data-auto="true" method="post"
style="width: 90%;padding-top: 10px">
<input type="hidden" name="id" value="<?= $row['id'] ?>"/>
<div class="am-form-group">
<label class="am-para-label">姓名:</label>
<div class="am-para-input w300">
<input type="text" placeholder="输入姓名" name="uname" value="<?=$row['uname']?>" maxlength="30"/>
<input type="text" placeholder="输入姓名" name="uname" v-model="info.uname" maxlength="30"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">手机号:</label>
<div class="am-para-input w300">
<input type="text" placeholder="输入手机号" name="mobile" value="<?=$row['mobile']?>" maxlength="30"/>
<input type="text" placeholder="输入手机号" name="mobile" v-model="info.mobile" maxlength="30"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">角色:</label>
<div class="am-para-input w100">
<select name="group_id">
<?foreach($groups as $key=>$val){?>
<option value="<?=$key?>" <?=$key==$row['group_id']?'selected':''?>><?=$val?></option>
<?}?>
<select name="group_id" v-model="info.group_id" @change="resetBiz">
<option value="">选择角色</option>
<option :value="i" v-for="(v,i) in groups">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group" v-if="info.group_id==4">
<label class="am-para-label">所在城市:</label>
<div class="am-para-input w100">
<select v-model="info.city_id">
<option value="0">选择城市</option>
<option :value="v.city_id" v-for="(v,i) in show_info.cityList">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">门店:</label>
<div class="am-para-inline lh-default">
<button class="am-btn am-btn-default" type="button" @click="brandModal">选择门店</button>
<div class="mt5">
<button class="am-btn am-btn-default mr5" type="button" @click="brandModal"
v-for="(item) in selectedBrands">{{item.name}}
</button>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input"><button class="am-btn am-btn-success" type="submit">提交</button></div>
<div class="am-para-input">
<button class="am-btn am-btn-success" type="button" @click='saveEdit'>提交</button>
</div>
</div>
<div id="brand-modal" style="display:none">
<div class="modal-body">
<div class="header">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<div class="am-form-group am-para-inline w150">
<select title="城市" v-model="search_info.city_id">
<option value="0">城市</option>
<template v-for="(v,i) in cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="行政区" v-model="search_info.county_id">
<option value="0">行政区</option>
<template v-for="(v,i) in countyAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group fl ml10">
<a class="am-btn am-btn-success am-btn-sm w100" @click="search()">搜索</a>
</div>
</div>
</div>
<div style="padding-top: 10px;">
<div class="vuetable-body-wrapper">
<table class="vuetable table table-middle table-hover fixed">
<colgroup>
<col class="vuetable-col-title" style="width: 50%;">
<col class="vuetable-col-actions text-right" style="width: 10%;">
</colgroup>
<thead>
<tr>
<th class="vuetable-th-slot-title">商家名</th>
<th class="vuetable-th-slot-actions text-right">操作</th>
</tr>
</thead>
<tfoot></tfoot>
<tbody class="vuetable-body">
<tr v-for="(v,i) in brandsList">
<td class="vuetable-slot">
{{v.name}}
</td>
<td class="vuetable-slot text-right">
<button type='button' v-if="v.is_checked==0 || !v.is_checked"
class="btn btn-sm btn-success"
@click="addItem(i)">添加
</button>
<button type='button' v-if="v.is_checked==1" class="btn btn-sm btn-danger"
@click="removeItem(v)">删除
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="clearfix">
<span class="pull-left text-muted">{{brandsPage.page}}(每页{{brandsPage.pageLimit}},{{brandsPage.pageCount}})</span>
<nav class="pull-right" aria-label="Page navigation">
<ul class="pagination pagination-sm">
<li>
<a href="javascript:void(0);" @click="beforeShopPage();" aria-label="上一页">
<span class="glyphicon glyphicon-menu-left"></span>
</a>
</li>
<li v-if="brandsPage.hasNext">
<a href="javascript:void(0);" @click="afterShopPage();" aria-label="下一页">
<span class="glyphicon glyphicon-menu-right"></span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</form>
<script type="text/javascript">
var vue_app;
var loading = false;
$(function () {
vue_app = new Vue({
el: '#vue-edit',
data: {
info: {},
groups: [],
biz: {bizAry: [], biz_id: ''},
brandsThPage: 0,
brandsPage: [],
bizIds: [],
brandsList: [],
selectedBrands: [],
cityAry: [],
countyAry: [],
show_info: {cityList: []},
search_info: {city_id: 0, county_id: 0}
},
computed: {},
created: function () {
},
updated: function () {
},
mounted: function () {
var vm = this;
vm.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
vm.groups = <?=json_encode($groups, JSON_UNESCAPED_UNICODE)?>;
vm.selectedBrands = <?=json_encode($selectedBrands, JSON_UNESCAPED_UNICODE)?>;
vm.show_info = <?=json_encode($show_info, JSON_UNESCAPED_UNICODE)?>;
vm.init_citys();
},
methods: {
resetBiz: function () {
this.selectedBrands = [];
},
search: function () {
this.changePage(1);
},
changePage: function (page) {
var that = this;
that.brandsThPage = page;
return this.brandModal();
},
beforeShopPage: function () {
var vm = this;
if (vm.brandsThPage == 1) {
alert('已经是第一页了');
return;
}
vm.brandsThPage--;
return this.brandModal();
},
afterShopPage: function () {
var vm = this;
vm.brandsThPage++;
return this.brandModal();
},
addItem: function (index) {
var vm = this;
var brand_id;
var biz_id;
biz_id = vm.brandsList[index]['id'];
var _shop = {
biz_id: biz_id,
name: vm.brandsList[index]['name'],
};
if (vm.info.group_id == 4) {
vm.selectedBrands.push(_shop);
vm.brandsList[index]['is_checked'] = 1;
} else {
vm.selectedBrands = [];
vm.selectedBrands.push(_shop);
this.brandsList.map(function (_item, _index) {
if (vm.brandsList[index]['id'] == _item['id']) {
vm.brandsList[_index]['is_checked'] = 1;
} else {
vm.brandsList[_index]['is_checked'] = 0;
}
})
}
},
removeItem: function (item) {
var vm = this;
if (vm.info.group_id == 4) {
this.selectedBrands = this.selectedBrands.filter(function (_item) {
var id = _item.biz_id > 0 ? _item.biz_id : _item.brand_id;
return id != item.id;
})
} else {
vm.selectedBrands = [];
}
this.brandsList.map(function (_item, _index) {
if (item.id == _item.id) {
vm.brandsList[_index].is_checked = 0;
}
})
},
//选择商家
brandModal: function () {
var that = this;
layer.open({
type: 1,
area: ['55%', '80%'], //宽高
content: $('#brand-modal'),
title: '选择商家',
shade: false,
btn: ['选好了'],
yes: function (index) {
layer.close(index);
}
});
$.ajax({
url: '/common/shop_app',
type: 'post',
dataType: 'json',
data: {
page: that.brandsThPage,
city_id: that.search_info.city_id,
county_id: that.search_info.county_id
},
success: function (json) {
var brandsList = json.data.shopList;
that.brandsPage = json.data.shopPage;
brandsList.map(function (_item, _index) {
for (var index in that.selectedBrands) {
var item = that.selectedBrands[index];
var id = that.sys_type_id == 1 ? item.brand_id : item.biz_id;
if (id == _item.id) {
brandsList[_index].is_checked = 1;
break;
} else {
brandsList[_index].is_checked = 0;
}
}
})
that.brandsList = brandsList;
}
});
},
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
if (vm.search_info.city_id > 0) {
$.get('common/area', {id: vm.search_info.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
}
},
saveEdit: function () {
if (loading) {
return;
}
var vm = this;
vm.info.bizs = vm.selectedBrands;
loading = true;
$.ajax({
url: '<?=$action?>',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = false;
if (data.code) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
window.location.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
}
});
}
},
watch: {
'search_info.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.search_info.county_id = 0;
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
});
}
},
}
});
});
</script>
+172 -7
View File
@@ -14,23 +14,59 @@
<input type="text" name="mobile" value="<?= $mobile ?>"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">角色:</label>
<div class="am-para-inline w150">
<select name="group_id">
<option value="">全部</option>
<?php foreach ($groupAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['group_id'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group am-para-inline w150">
<select title="城市" name="city_id" v-model="params.city_id">
<option value="">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="行政区" name="county_id" v-model="params.county_id">
<option value="">行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="门店" name="biz_id" v-model="params.biz_id">
<option value="">选择门店</option>
<option :value="v.id" v-for="(v,i) in bizAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" data-modal="/app/licheb/member/get" class="am-btn am-btn-success am-btn-sm w100">添加用户</button>
<button type="button" data-open="/app/licheb/member/get" class="am-btn am-btn-success am-btn-sm w100">
添加用户
</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>ID</span></th>
<th width="20%"><span>昵称</span></th>
<th width="20%"><span>姓名</span></th>
<th width="20%"><span>手机号码</span></th>
<th width="20%"><span>角色</span></th>
<th width="20%"><span>门店</span></th>
<th width="20%"><span>创建时间</span></th>
</tr>
</thead>
@@ -38,11 +74,37 @@
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['nickname'] ?></td>
<td><?= $v['uname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['group_name']?></td>
<td><?= date('Y-m-d H:i:s',$v['c_time']) ?></td>
<td><?= $v['group_name'] ?></td>
<td><?= $v['biz_name'] ?></td>
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
</tr>
<tr>
<td colspan="6" class="align-r">
<input type="hidden" class="id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".id-<?= $v['id'] ?>"
data-action="/app/licheb/member/batch" data-field=""
style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>下架</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>上架</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
<a data-open="/app/licheb/member/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">修改</a>
<? if ($v['umajia']) { ?>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/appusual/umajia/get?uid=<?= $v['id'] ?>&app_id=<?= $app_id ?>"
data-title="编辑马甲">编辑马甲</a>
<a href="javascript:void(0)" data-ajax="post"
data-action="/app/appusual/umajia/del?app_id=<?= $app_id ?>"
data-params-uid="<?= $v['id'] ?>" class="am-btn am-btn-xs am-btn-danger">脱去马甲</a>
<? } elseif (isset($v['umajia'])) { ?>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/appusual/umajia/get?uid=<?= $v['id'] ?>&app_id=<?= $app_id ?>"
data-title="披上马甲">披上马甲</a>
<? } ?>
</td>
</tr>
<?php } ?>
</tbody>
@@ -56,8 +118,111 @@
</div>
</div>
<script>
$('#bd-hd-city').change(function () {
var city = $(this).find('option:selected').text();
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
cityAry: [],//城市
countyAry: [],//行政区
bizAry: [],
province_id: '350'
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.init_citys(vm.province_id);
},
methods: {
init_citys: function (province_id) {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: province_id,
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
get_bizs: function () {
var that = this;
if (that.params.city_id > 0 || that.params.county_id > 0) {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
province_id: that.province_id,
city_id: that.params.city_id,
county_id: that.params.county_id,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.bizAry = response.data.list;
if (that.params.biz_id > 0) {
var biz_id = '';
for (var i in that.bizAry) {
if (that.params.biz_id == that.bizAry[i].id) {
biz_id = that.params.biz_id;
break;
}
}
that.params.biz_id = biz_id;
}
}
}
});
} else {
that.bizAry = [];
that.params.biz_id = '';
}
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
that.get_bizs();
},
'params.county_id': function (nv, ov) {
var that = this;
that.get_bizs();
}
}
});
$(function () {
<?php page_script($pager) ?>
});
$('#majia').change(function () {
@@ -0,0 +1,122 @@
<div class="am-g">
<div class="col-sm-12">
<?php foreach ($menu_lists as $key => $value) { ?>
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
<?= $value['title'] ?>
</div>
<div class="text-center" style="padding-top: 3px;">
<span><?= $value['value'] ?></span> <?= $value['num_tag'] ?>
</div>
</div>
</div>
<? } ?>
</div>
</div>
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/sytbiz/get_achievement">
<input type="hidden" name="a_id" value="<?= $params['a_id'] ?>">
<input type="hidden" name="biz_id" value="<?= $params['biz_id'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>"
placeholder="统计日期范围"/>
</div>
</div>
<div class="am-form-group fl mb10" style="margin-top: 5px">
<div class="am-para-inline w300">
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);"
data-date="yesterday">昨日</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>ID</span></th>
<th width="25%"><span>用户</span></th>
<th width="50%"><span>内容</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['nickname'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
//日期范围
laydate.render({
elem: '#order-lists-time', range: '~'
});
$('.order-lists-time-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
}
$('#order-lists-time').val(date);
});
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.tab-active {
background-color: #5cb85c;
color: #fff;
}
.my-panel span {
font-size: 20px;
}
</style>
@@ -0,0 +1,60 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/sytbiz/lists">
<input type="hidden" name="a_id" value="<?= $params['a_id'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">门店名称:</label>
<div class="am-para-inline w200">
<input type="text" name="biz_name" value="<?= $params['biz_name'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml100">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>门店ID</span></th>
<th width="15%"><span>门店</span></th>
<th width="10%"><span>分数</span></th>
<th width="10%"><span>报名</span></th>
<th width="10%"><span>浏览</span></th>
<th width="10%"><span>分享</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="10%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_id'] ?></td>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['score'] ?></td>
<td><?= $v['enroll_count'] ?></td>
<td><?= $v['browse_count'] ?></td>
<td><?= $v['share_count'] ?></td>
<td><?= $v['c_time'] ?></td>
<td>
<a data-open="/app/licheb/sytbiz/get_achievement?a_id=<?= $params['a_id'] ?>&biz_id=<?= $v['biz_id'] ?>"
class="am-btn am-btn-primary am-btn-xs">业绩报告</a></td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
@@ -0,0 +1,555 @@
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div id="vue-edit">
<div class="am-g">
<div class="col-sm-12" style="margin-bottom: 20px;">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select v-if="info.id==0" id="status" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
<select v-else id="status" disabled="disabled" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div v-if="info.id>0" class="am-form-inline"
style="text-align:right;padding-right: 10px;padding-top: 35px;">
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-if="info.editType==1">取消编辑</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-else>编辑状态</a>
</div>
<div class="am-form-group ml10" v-if="info.editType==1">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveStatus()">保存状态</a>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">活动信息</span>
<span style="float:right;margin-top:5px">
<a href="javascript:" @click="editType(2)"><i class="fa fa-edit"></i></a></span>
</div>
<div class="am-panel-bd am-g">
<div class="am-form-group">
<label class="am-para-label">活动专题:</label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group" style="width: 30%">
<input type="text" v-model="info.z_title" disabled="disabled">
</div>
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="topicsModal">选择</a>
</div>
<div class="am-form-group">
<span class="f12 clr999 lh-default ml10">注:活动页面只能从现有的专题中选择</span>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动品牌:</label>
<div class="am-para-input">
<div class="am-g" style="margin-left: 3px;">
<label class="mr10" style="margin-top: 7px" v-for="(v,i) in auto_brands">
<input type="checkbox" :value="v.id" v-model="info.brand_id"/> {{v.name}}
</label>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动标题:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动封面:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cover"><i class="am-icon-cloud-upload"></i> 上传封面
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<input type="hidden" name="cover" id="cover_id"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $info['img'] ?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $info['img_url'] ?>"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">海报图片:</label>
<div class="am-para-input">
<p><a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm"
data-file="999" data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu"
data-mark="goods">上传图片</a></p>
<div class="photo-upload">
<div class="photo-upload-item" v-for="(v,i) in goods.imgs_url">
<img :src="v.src" class="img-thumbnail" :data-value="v.value" data-tips-image
style="width:100px;height:100px;">
<span class="photo-upload-item-remove"><i class="fa fa-remove"
@click="removeImgs(i);"></i></span>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分享描述:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.share_title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动时间:</label>
<div class="am-para-input" style="width: 50%">
<input id="time_id" value="<?= $info['time'] ?>" type="text" placeholder="开始日期 ~ 结束日期"
autocomplete="off"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">备注:</label>
<div class="am-para-input" style="width: 80%">
<textarea rows="3" v-model="info.remark"></textarea>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">规则:</label>
<div class="am-para-input" style="width: 80%">
<textarea rows="3" v-model="info.rule"></textarea>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">背景色:</label>
<div class="am-para-input" style="width: 15%">
<input type="text" v-model="info.bg_color">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">按扭色:</label>
<div class="am-para-input" style="width: 15%">
<input type="text" v-model="info.btn_color">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">配置KPI</label>
<div class="am-para-input">
<div v-for="(v,i) in info.kpi_list" class="am-form-inline" style="padding-bottom: 10px;">
<div class="am-form-group">{{v.title}}</div>
<div class="am-form-group" style="width: 10%">
<input type="text" v-model="v.num">
</div>
<div class="am-form-group">{{v.num_tag}}</div>
<div class="am-form-group" style="width: 10%;margin-left: 15px;">
<input type="text" v-model="v.score">
</div>
<div class="am-form-group">{{v.score_tag}}</div>
</div>
</div>
</div>
<div class="am-form-group" v-if="info.editType==2">
<label class="am-para-label"></label>
<div class="am-para-input" style="width: 60%">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">保存活动信息</a>
</div>
</div>
</div>
</div>
</div>
<div id="topics-modal" style="display: none;">
<div class="modal-body">
<div class="header">
<form class="form-inline">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" v-model="topicsName" placeholder="专题名"/>
<div class="input-group-btn">
<a href="javascript:" class="btn btn-primary btn-stroke"
@click="searchByTopicsName()">
<i class="fa fa-search"></i></a></div>
</div>
</div>
</form>
</div>
<div style="padding-top: 10px;">
<div class="vuetable-body-wrapper">
<table class="vuetable table table-middle table-hover fixed">
<colgroup>
<col class="vuetable-col-title" style="width: 50%;">
<col class="vuetable-col-actions text-right">
</colgroup>
<thead>
<tr>
<th class="vuetable-th-slot-title" style="width: 50%;">专题名</th>
<th class="vuetable-th-slot-actions text-right">操作</th>
</tr>
</thead>
<tfoot></tfoot>
<tbody class="vuetable-body">
<tr v-for="(v,i) in topicsList">
<td class="vuetable-slot" style="width: 50%;">
<div>
{{v.title}}
</div>
</td>
<td class="vuetable-slot text-right">
<button type='button' v-if="v.selected==0 || !v.selected"
class="btn btn-sm btn-success"
@click="addTopicsItem(v)">添加
</button>
<button type='button' v-if="v.selected==1" class="btn btn-sm btn-danger"
@click="removeTopicsItem(v)">删除
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="clearfix">
<span class="pull-left text-muted">{{topicsPage.page}}(每页{{topicsPage.pageLimit}},{{topicsPage.pageCount}})</span>
<nav class="pull-right" aria-label="Page navigation">
<ul class="pagination pagination-sm">
<li>
<a href="javascript:void(0);" @click="beforeTopicsPage();" aria-label="上一页">
<span class="glyphicon glyphicon-menu-left"></span>
</a>
</li>
<li v-if="topicsPage.hasNext">
<a href="javascript:void(0);" @click="afterTopicsPage();" aria-label="下一页">
<span class="glyphicon glyphicon-menu-right"></span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#time_id', range: '~', type: 'datetime'
, done: function (value, date, endDate) {
if (endDate.hours == "0" && endDate.minutes == "0" && endDate.seconds == "0") {
// 改变结束时间默认值
$(".layui-laydate-footer [lay-type='datetime'].laydate-btns-time").click();
$(".laydate-main-list-1 .layui-laydate-content li ol li:last-child").click();
$(".layui-laydate-footer [lay-type='date'].laydate-btns-time").click();
}
}
});
});
var layer_open;
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
goods: {"imgs_url": [], "imgs": []},
status_list: [],
topicsName: '',
topicsList: [],
topicsPage: [],
topicsThPage: 0,
auto_brands: [],
},
mounted() {
var that = this;
that.info = <?=json_encode($info)?>;
that.status_list = <?=json_encode($status_list)?>;
that.goods = <?=json_encode($posters)?>;
that.init_auto_brands();
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
init_auto_brands: function () {
var vm = this;
$.ajax({
url: '/auto/brand/json_lists',
type: 'post',
dataType: 'json',
data: {status: 1},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
vm.auto_brands = data.data.list;
}
},
complete: function () {
}
});
},
removeImgs: function (index) {
var vm = this;
vm.goods.imgs_url.splice(index, 1);
vm.goods.imgs.splice(index, 1);
},
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.editType == 1) {
$("#status").attr("disabled", "disabled");
vm.info.editType = 0;
} else {
$("#status").removeAttr("disabled");
vm.info.editType = 1;
}
} else if (index == 2) {
if (vm.info.editType == 2) {
vm.info.editType = 0;
} else {
vm.info.editType = 2;
}
} else {
vm.info.editType = 0;
}
},
//选择活动专题
topicsModal: function () {
var that = this;
layer.open({
type: 1,
area: ['45%', '80%'], //宽高
content: $('#topics-modal'),
title: '选择活动专题',
shade: false,
btn: ['选好了'],
yes: function (index) {
layer.close(index);
}
});
$.ajax({
url: '/app/licheb/sytactivity/get_topics',
type: 'post',
dataType: 'json',
data: {
page: that.topicsThPage,
title: that.topicsName,
},
success: function (json) {
var topicsList = json.data.topicsList;
that.topicsPage = json.data.topicsPage;
topicsList.map(function (_item, _index) {
if (that.info.z_id == _item.id) {
topicsList[_index].selected = 1;
} else {
topicsList[_index].selected = 0;
}
})
that.topicsList = topicsList;
}
});
},
beforeTopicsPage: function () {
var vm = this;
if (vm.topicsThPage == 1) {
alert('已经是第一页了');
return;
}
vm.topicsThPage--;
return this.topicsModal();
},
afterTopicsPage: function () {
var vm = this;
vm.topicsThPage++;
return this.topicsModal();
},
addTopicsItem: function (item) {
var vm = this;
vm.info['z_id'] = item.id;
vm.info['z_title'] = item.title;
this.topicsList.map(function (_item, _index) {
if (item.id == _item.id) {
_item.selected = 1;
} else {
_item.selected = 0;
}
})
},
removeTopicsItem: function (item) {
var vm = this;
vm.info['z_id'] = 0;
vm.info['z_title'] = '';
this.topicsList.map(function (_item, _index) {
if (item.id == _item.id) {
vm.topicsList[_index].selected = 0;
}
})
},
saveEdit: function () {
var vm = this;
vm.info.time = $('#time_id').val();
vm.info.img = $('#cover_id').val();
vm.info.posters = vm.goods.imgs;
$.ajax({
url: vm.info.edit_url,
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
if (data['data']['type'] == 'add') {
window.location.href = "#/app/licheb/sytactivity/get?id=" + data['data']['id'] + "?spm=<?= $_GET['spm'] ?>";
} else {
$.form.reload();
}
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
saveStatus: function () {
var vm = this;
$.ajax({
url: '/app/licheb/sytactivity/edit_status',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
}
});
});
</script>
<style type="text/css">
.label-width {
width: 150px
}
.my-ul ul li {
padding: 10px;
}
.my-panel {
padding: 10px;
border: 1px solid #ddd;
height: 90px;
}
.auto-content {
width: min-content;
min-width: 50%;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
.photo-upload {
position: relative;
font-size: 0;
}
.photo-upload:after {
content: "";
display: table;
clear: both;
}
.photo-upload-item {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
font-size: 12px; /*display:inline-block;width:120px;*/
}
.photo-upload-item > img {
}
.photo-upload-item-check,
.photo-upload-item-remove {
opacity: 0;
position: absolute;
top: -8px;
right: -8px;
width: 24px;
height: 24px;
line-height: 24px;
border: 1px solid #fff;
background-color: #eee;
border-radius: 50%;
text-align: center;
cursor: pointer;
}
.photo-upload-item:hover .photo-upload-item-remove {
opacity: 1;
transition: all .4s ease
}
.photo-upload-item-check {
opacity: 1;
background-color: #36f;
color: #fff;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/hd.css?v=1581252500">
@@ -0,0 +1,78 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/sytactivity">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">活动标题:</label>
<div class="am-para-inline w200">
<input type="text" name="title" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml100">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" data-open="/app/licheb/sytactivity/get"
class="am-btn am-btn-success am-btn-sm w100">新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>ID</span></th>
<th width="15%"><span>活动标题</span></th>
<th width="15%"><span>专题</span></th>
<th width="10%"><span>开始时间</span></th>
<th width="10%"><span>结束时间</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="8%"><span>状态</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td align="left"><?= $v['title'] ?></td>
<td align="left"><a href="javascript:void(0);"
data-open="/topics/topics/get?id=<?= $v['z_id'] ?>"><?= $v['z_title'] ?></a>
</td>
<td><?= $v['s_time'] ?></td>
<td><?= $v['e_time'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><?= $v['status_name'] ?></td>
</tr>
<tr>
<td colspan="7" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/receiver/customer?cfrom_id=35&t_id=<?= $v['id'] ?>">报名</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/lists?a_id=<?= $v['id'] ?>">门店</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/get_achievement?a_id=<?= $v['id'] ?>">业绩报告</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_qrcode?url=<?= $v['url'] ?>"
data-title="分享二维码">分享二维码</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytactivity/get?id=<?= $v['id'] ?>">编辑</a>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
+499
View File
@@ -0,0 +1,499 @@
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div id="vue-edit">
<div class="am-g">
<div class="col-sm-12" style="margin-bottom: 20px;">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select v-if="info.id==0" id="status" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
<select v-else id="status" disabled="disabled" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div v-if="info.id>0" class="am-form-inline"
style="text-align:right;padding-right: 10px;padding-top: 35px;">
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-if="info.editType==1">取消编辑</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-else>编辑状态</a>
</div>
<div class="am-form-group ml10" v-if="info.editType==1">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveStatus()">保存状态</a>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">直播信息</span>
<span style="float:right;margin-top:5px">
<a href="javascript:" @click="editType(2)"><i class="fa fa-edit"></i></a></span>
</div>
<div class="am-panel-bd am-g">
<div class="am-form-group">
<label class="am-para-label">标题:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">头部图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cover"><i class="am-icon-cloud-upload"></i> 上传封面
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<input type="hidden" name="cover" id="cover_id"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $info['img'] ?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $info['img_url'] ?>"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">直播场次:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.session_id">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">直播时间:</label>
<div class="am-para-input" style="width: 30%">
<input id="time_id" value="<?= $info['time'] ?>" type="text" placeholder="开始日期 ~ 结束日期"
autocomplete="off"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动规则:</label>
<div class="am-para-input" style="width: 80%">
<textarea rows="4" v-model="info.rule"></textarea>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分享描述:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.share_title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分享图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="share_img"><i class="am-icon-cloud-upload"></i> 上传封面
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<input type="hidden" name="share_img" id="share_img_id"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $info['share_img'] ?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $info['share_img_url'] ?>"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">奖品说明:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.prizes_note">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">配置奖品:</label>
<div class="am-para-input">
<div class="col-sm-10">
<table class="table table-hover table-middle" style="table-layout:fixed">
<colgroup>
<col width="80px"/>
<col width="30%">
<col width="15%">
<col width="30%"/>
<col width="">
</colgroup>
<thead>
<tr>
<th class="text-center">图片</th>
<th class="text-center">标题</th>
<th class="text-center">排序</th>
<th class="text-center">链接</th>
<th class="text-right">
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
@click='adModal()'>添加</a>
</th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in ad_list">
<tr>
<td><img data-tips-image :src="item.img_url"></td>
<td class="text-center">{{item.title}}</td>
<td class="text-center">
<div :id="'group_name_txt_'+index">{{item.order_view}} <a href="javascript:"
@click="showGroupEditForm(index)"><i
class="fa fa-edit"></i></a></div>
<input :id="'group_name_'+index" @blur="editGroupName(index,item.id)"
style="display: none;" type="number" class="form-control"
v-model="item.order_view" placeholder="请输入排序值">
</td>
<td class="text-center" v-if="item.jump_type==1">报名弹窗</td>
<td class="text-center" v-else>{{item.link}}</td>
<td class="text-right">
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-default btn-sm" @click='adModal(item)'>编辑</a>
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-danger btn-sm" @click='removeAd(index)'>删除</a>
</td>
</tr>
</template>
</tbody>
</table>
<template v-if="ad_list.length <=0">
<div style="text-align: center;">无数据</div>
</template>
</div>
<div id="ad-modal" style="display: none;">
<div class="form-horizontal" style="padding-top: 20px;">
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">标题</label>
<div class="col-sm-8">
<input type="text" class="form-control" v-model="ad_item.title"
placeholder="请输入标题">
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">图片</label>
<div class="col-sm-8">
<div class="input-group" style="width: 100%">
<input type="text" style="width: 60%" name="ad_img" id="ad_img"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
class="form-control">
<img data-tips-image name="ad_img_url" id="ad_img_url"
style="height:auto;max-height:31px;min-width:31px;margin-left: 5px;margin-right: 5px;"
/>
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="ad_img">上传图片
</button>
</div>
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">排序值</label>
<div class="col-sm-4">
<input type="number" class="form-control" v-model="ad_item.order_view"
placeholder="请输入排序">
</div>
<div style="padding-top:7px;">
<small class="text-muted">越大越靠前</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="am-form-group" v-if="info.editType==2">
<label class="am-para-label"></label>
<div class="am-para-input" style="width: 60%">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">保存活动信息</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#time_id', range: '~', type: 'datetime'
, done: function (value, date, endDate) {
if (endDate.hours == "0" && endDate.minutes == "0" && endDate.seconds == "0") {
// 改变结束时间默认值
$(".layui-laydate-footer [lay-type='datetime'].laydate-btns-time").click();
$(".laydate-main-list-1 .layui-laydate-content li ol li:last-child").click();
$(".layui-laydate-footer [lay-type='date'].laydate-btns-time").click();
}
}
});
});
var layer_open;
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
status_list: [],
ad_list: [],
ad_item: {},
},
mounted() {
var that = this;
that.info = <?=json_encode($info)?>;
that.status_list = <?=json_encode($status_list)?>;
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
// 修改排序
showGroupEditForm: function (index) {
$("#group_name_" + index).show();
$("#group_name_txt_" + index).hide();
$('#group_name_' + index).focus();
},
// 排序
editGroupName: function (index, group_id) {
var order_view = $("#group_name_" + index).val();
if (order_view == '') {
layer.msg("排序值不能为空!", {icon: 2});
return false;
}
this.ad_list.sort(function (a, b) {
return b.order_view - a.order_view;
});
$("#group_name_" + index).hide();
$("#group_name_txt_" + index).show();
},
adModal: function (item) {
var that = this;
var _title = '新增广告';
that.ad_item = {};
var _img = '';
var _img_url = '';
if (item) {
that.ad_item = item;
_title = '编辑广告';
_img = item.img;
_img_url = item.img_url;
} else {
that.ad_item = {"order_view": 50, "jump_type": 0};
}
$('#ad_img').val(_img);
$("#ad_img_url").attr('src', _img_url);
layer.open({
type: 1,
area: ['50%', '38%'], //宽高
content: $('#ad-modal'),
title: _title,
shade: false,
btn: ['确定', '取消'],
yes: function (index) {
_img = $('#ad_img').val();
_img_url = $("#ad_img_url")[0].src;
if (!item) {
that.ad_list.push({
title: that.ad_item.title,
img: _img,
img_url: _img_url,
link: that.ad_item.link,
order_view: that.ad_item.order_view,
jump_type: that.ad_item.jump_type
});
} else {
item.img = _img;
item.img_url = _img_url;
}
that.ad_list.sort(function (a, b) {
return b.order_view - a.order_view;
})
layer.close(index);
}
});
},
removeAd: function (index) {
var vm = this;
vm.ad_list.splice(index, 1);
},
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.editType == 1) {
$("#status").attr("disabled", "disabled");
vm.info.editType = 0;
} else {
$("#status").removeAttr("disabled");
vm.info.editType = 1;
}
} else if (index == 2) {
if (vm.info.editType == 2) {
vm.info.editType = 0;
} else {
vm.info.editType = 2;
}
} else {
vm.info.editType = 0;
}
},
saveEdit: function () {
var vm = this;
vm.info.img = $('#cover_id').val();
vm.info.time = $('#time_id').val();
vm.info.share_img = $('#share_img_id').val();
$.ajax({
url: vm.info.edit_url,
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
if (data['data']['type'] == 'add') {
window.location.href = "#/app/licheb/sytlive/get?id=" + data['data']['id'] + "?spm=<?= $_GET['spm'] ?>";
} else {
$.form.reload();
}
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
saveStatus: function () {
var vm = this;
$.ajax({
url: '/app/licheb/sytactivity/edit_status',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
}
});
});
</script>
<style type="text/css">
.label-width {
width: 150px
}
.my-ul ul li {
padding: 10px;
}
.my-panel {
padding: 10px;
border: 1px solid #ddd;
height: 90px;
}
.auto-content {
width: min-content;
min-width: 50%;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
.photo-upload {
position: relative;
font-size: 0;
}
.photo-upload:after {
content: "";
display: table;
clear: both;
}
.photo-upload-item {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
font-size: 12px; /*display:inline-block;width:120px;*/
}
.photo-upload-item > img {
}
.photo-upload-item-check,
.photo-upload-item-remove {
opacity: 0;
position: absolute;
top: -8px;
right: -8px;
width: 24px;
height: 24px;
line-height: 24px;
border: 1px solid #fff;
background-color: #eee;
border-radius: 50%;
text-align: center;
cursor: pointer;
}
.photo-upload-item:hover .photo-upload-item-remove {
opacity: 1;
transition: all .4s ease
}
.photo-upload-item-check {
opacity: 1;
background-color: #36f;
color: #fff;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/hd.css?v=1581252500">
+76
View File
@@ -0,0 +1,76 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/licheb/sytlive">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">活动标题:</label>
<div class="am-para-inline w200">
<input type="text" name="title" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml100">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" data-open="/app/licheb/sytlive/get"
class="am-btn am-btn-success am-btn-sm w100">新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>ID</span></th>
<th width="15%"><span>标题</span></th>
<th width="15%"><span>直播场次</span></th>
<th width="10%"><span>开始时间</span></th>
<th width="10%"><span>结束时间</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="8%"><span>状态</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['session_id'] ?></td>
<td><?= $v['s_time'] ?></td>
<td><?= $v['e_time'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><?= $v['status_name'] ?></td>
</tr>
<tr>
<td colspan="7" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/receiver/customer?cfrom_id=35&t_id=<?= $v['id'] ?>">报名</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/lists?a_id=<?= $v['id'] ?>">门店</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/get_achievement?a_id=<?= $v['id'] ?>">业绩报告</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_qrcode?url=<?= $v['url'] ?>"
data-title="分享二维码">分享二维码</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytlive/get?id=<?= $v['id'] ?>">编辑</a>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
+297
View File
@@ -0,0 +1,297 @@
<table width="100%">
<tr>
<? foreach ($menus as $key => $value) { ?>
<td class="my-panel text-center">
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
</td>
<? } ?>
</tr>
</table>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="app/licheb/userslog">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">顾问名字:</label>
<div class="am-para-inline w200">
<input type="text" name="uname" placeholder="顾问名字关键字" v-model="params.uname"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">门店:</label>
<div class="am-para-inline w120">
<select title="类型" name="type" v-model="params.type">
<option value="">选择类型</option>
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select title="城市" name="city_id" v-model="params.city_id">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select title="行政区" name="county_id" v-model="params.county_id" @change="set_county">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<select title="门店" name="biz_id" v-model="params.biz_id">
<option value="">选择门店</option>
<option :value="v.id" v-for="(v,i) in bizAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w80">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w250">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="开始时间 ~ 结束时间" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fl"></div>
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="17%"><span>门店</span></th>
<th width="10%"><span>顾问</span></th>
<th width="20%"><span>客户数</span></th>
<th width="13%"><span>进店人数/进店次数</span></th>
<th width="9%"><span>试驾数</span></th>
<th width="9%"><span>跟进数</span></th>
<th width="9%"><span>订单数</span></th>
<th width="9%"><span>战败数</span></th>
<th width="9%"><span>开票数</span></th>
<th width="9%"><span>新增企微</span></th>
<th width="9%"><span>删除企微</span></th>
<th width="10%"><span>日期</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['uname'] ?></td>
<td><?= $v['customers'] ?></td>
<td><?= $v['c_num'] ?>/<?= $v['a_num'] ?></td>
<td><?= $v['t_num'] ?></td>
<td><?= $v['follows'] ?></td>
<td><?= $v['orders'] ?></td>
<td><?= $v['defeats'] ?></td>
<td><?= $v['bills'] ?></td>
<td><?= $v['qy_adds'] ?></td>
<td><?= $v['qy_dels'] ?></td>
<td><?= $v['log_date'] ?></td>
</tr>
<? }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-time';
var beginDate = '';
var endDate = '';
switch (type) {
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
typeAry: [],//城市
cityAry: [],//城市
countyAry: [],//行政区
bizAry: [],//门店
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.typeAry = <?=json_encode($typeAry)?>;
vm.init_citys();
},
methods: {
init_citys: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: '350',
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
set_county: function () {
var that = this;
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
},
reset: function () {
var that = this;
that.params.city_id = '';
that.params.uname = '';
that.params.type = '';
$('#id-time').val('');
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
},
'params.county_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
} else {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
city_id: that.params.city_id,
county_id: that.params.county_id,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.bizAry = response.data.list;
var biz_id = '';
if (that.params.biz_id > 0 || that.params.biz_id == -1) {
for (var i in that.bizAry) {
if (that.params.biz_id == that.bizAry[i].id) {
biz_id = that.params.biz_id;
break;
}
}
}
that.params.biz_id = biz_id;
}
}
});
}
},
}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/app/licheb/userslog/export?' + arr[1];
window.location.href = href;
});
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.my-panel span {
font-size: 20px;
}
</style>
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More