532 Commits

Author SHA1 Message Date
小鱼开发 ab2fae2897 1 2026-05-22 18:00:18 +08:00
小鱼开发 44f3787f6f 1 2026-05-22 17:52:53 +08:00
小鱼开发 85f39078de 1 2026-05-14 14:03:17 +08:00
小鱼开发 d847169cf8 sms 2026-05-06 10:20:58 +08:00
小鱼开发 0114ab4b8e 2 2026-03-18 10:26:59 +08:00
小鱼开发 b29aa871f5 1 2026-03-18 10:26:40 +08:00
lccsw a4c07f557f 修改地址解析默认值 2026-03-17 14:55:24 +08:00
小鱼开发 8e96a11c92 1 2026-03-13 22:30:28 +08:00
小鱼开发 95690fb506 1 2026-03-13 22:17:14 +08:00
小鱼开发 a00d242e05 1 2026-03-13 22:00:29 +08:00
小鱼开发 61b8d57702 1 2026-03-13 21:57:55 +08:00
小鱼开发 dc68ff13cd 1 2026-03-13 21:55:09 +08:00
小鱼开发 e8113d2383 fixed 2026-03-01 17:34:32 +08:00
lccsw 6bf1d26d18 修改解锁发券逻辑 2025-12-31 09:55:59 +08:00
lccsw 92fce6af3f 修改优惠券详情获取品牌和车系 2025-12-29 23:20:38 +08:00
lccsw 9a38321eae 修改订单佣金结算 2025-12-19 09:27:01 +08:00
lccsw 2f74eb9c42 修改权限判断 2025-12-15 16:46:02 +08:00
lccsw 2cb5928eec 修改补贴金额 2025-12-15 14:35:32 +08:00
lccsw 1993749395 修改补贴金额 2025-12-15 11:35:51 +08:00
lccsw 641f8a7816 补贴审核增加佣金 2025-12-15 11:05:23 +08:00
lccsw db483cc4ba 修改身份证识别接口 2025-12-14 10:20:01 +08:00
lccsw 692310f9e5 导出未发放金额大于100 2025-12-12 15:40:49 +08:00
lccsw 3036c78f68 修改部门经理权限 2025-12-12 11:48:19 +08:00
lccsw bb48ae16b1 修改区域管理员限制 2025-12-12 10:14:23 +08:00
lccsw a10c1656a7 线索增加团队过滤 2025-12-12 10:11:52 +08:00
lccsw fc6f49eb6f 增加佣金发放状态 2025-12-11 11:06:42 +08:00
lccsw e7e299ee81 增加批量操作 2025-12-10 16:49:17 +08:00
lccsw b65cd6cccf 增加分佣查询 2025-12-10 14:55:10 +08:00
lccsw f8d43ef20c 修改实名认证查询 2025-12-09 19:50:38 +08:00
lccsw 615770b597 修改线索归属 2025-12-09 09:41:17 +08:00
lccsw 1aa4d4e52f 修改分佣获取线索分佣金额 2025-12-08 10:34:10 +08:00
lccsw 544a2c026d 增加websocket shell脚本 2025-12-06 09:47:25 +08:00
lccsw c606d99781 修改电话回调判断 2025-12-05 18:16:40 +08:00
lccsw b9808ffb30 增加后台发送优惠券 2025-12-05 14:59:24 +08:00
lccsw ead67fbe06 修改计算通话时长 2025-12-05 11:39:26 +08:00
lccsw fd28b98d6c 修复订单佣金计算使用参数错误 2025-12-04 15:25:35 +08:00
lccsw da51a60088 增加发票识别 2025-12-04 10:11:35 +08:00
lccsw 2308c4cc91 修改h5显示对应省份 2025-12-03 14:20:48 +08:00
lccsw 08a76fea26 修改消息推送 2025-12-03 13:49:15 +08:00
lccsw 61f80c87ae 添加日志 2025-12-03 11:48:51 +08:00
lccsw abc9922b73 增加日志 2025-12-03 11:27:30 +08:00
lccsw 1073606434 修复平安管理后台发送消息错误 2025-12-03 10:36:25 +08:00
lccsw 474e80dd30 增加日志 2025-12-03 10:20:20 +08:00
lccsw 98d1bec03f 修改管理后台线索日志 2025-12-03 10:08:11 +08:00
lccsw f2b6a082d0 修改后台消息来源 2025-12-03 09:23:06 +08:00
lccsw 5af2b47051 修改线索消息记录 2025-12-03 08:48:16 +08:00
lccsw 2b712b035b 修改平安后台推送消息日志 2025-12-02 17:13:41 +08:00
lccsw e13a0e4f9e 修改订单分佣脚本 2025-12-02 14:59:05 +08:00
lccsw 7a2a42287a 修改获取订单首付类型 2025-12-02 14:30:49 +08:00
lccsw e2bc1fa882 修改后台订单详情money_json格式化 2025-12-02 14:25:22 +08:00
lccsw 9e2c1fdd8d 修改订单详情显示 2025-12-02 12:00:55 +08:00
lccsw b26c2f2069 修改配置 2025-12-01 14:34:41 +08:00
lccsw 5e8413fb87 修改配置 2025-12-01 14:32:10 +08:00
lccsw 6e14becf62 修改线索发送消息脚本 2025-12-01 13:53:26 +08:00
lccsw 7e1a283b06 增加消息推送埋点 2025-11-29 10:40:16 +08:00
lccsw 0d2f22738d 增加声音提醒 2025-11-29 10:40:15 +08:00
lccsw ac484e8d62 完善后台消息提示 2025-11-29 10:40:14 +08:00
lccsw 1e83af14c6 增加后台查看消息记录 2025-11-29 10:40:14 +08:00
lccsw d1f5040f8e 后台增加wss连接 2025-11-29 10:40:13 +08:00
lccsw 864be75e2f 增加websoket服务端 2025-11-29 10:40:00 +08:00
lccsw 3ef25ee828 修改解锁时间赛选 2025-11-29 10:32:05 +08:00
lccsw 04653d31f8 修改导出线索 2025-11-24 17:21:37 +08:00
lccsw 91cd3e9e23 修改导出接口 2025-11-24 17:15:40 +08:00
lccsw aab56179f2 导出线索增加团队长 2025-11-24 17:09:25 +08:00
lccsw 3a641407b3 增加导出解锁时间 2025-11-22 18:25:17 +08:00
lccsw f8d380caf6 增加更新客户等级接口 2025-11-22 15:34:59 +08:00
lccsw 5df8c23f72 增加记录来源和报名对应cf_id 2025-11-21 10:46:13 +08:00
lccsw 5acd1c6e82 修改用户绑定 2025-11-21 00:37:51 +08:00
lccsw 586e07c336 修改接口支持app访问 2025-11-20 14:57:48 +08:00
小鱼开发 2a0c64297f 1 2025-11-17 17:41:47 +08:00
小鱼开发 5e1dafe1b1 1 2025-11-17 17:30:45 +08:00
小鱼开发 6d30da4803 1 2025-11-17 17:29:19 +08:00
lccsw 9f7941cb4a 修改小程序获取通话录音 2025-11-17 09:22:17 +08:00
lccsw f86efa348c 隐藏我的客服入口 2025-11-14 18:13:06 +08:00
lccsw 7a8788c974 修改线索列表显示是否解锁 2025-11-13 15:06:14 +08:00
lccsw fb149043dd 修改线索客户登记和购车时间 2025-11-13 11:41:55 +08:00
lccsw 0895a8ef69 修改管理后台导出线索和空间站后台客户等级筛选 2025-11-12 23:09:22 +08:00
lccsw 0f4675bcd9 修复派单发短信 2025-11-12 20:17:50 +08:00
lccsw a805235392 修改文案 2025-11-12 10:26:54 +08:00
lccsw 529576d235 修改客户登记文案 2025-11-12 10:05:19 +08:00
lccsw a857f6e60c 修改购车意向文案 2025-11-12 09:20:17 +08:00
lccsw 2025dc560f 修复同步线索日志 2025-11-11 22:33:16 +08:00
lccsw bf72618fa0 增加回调日志 2025-11-11 22:23:09 +08:00
lccsw 16b4bbda1b 后台线索派单发短信增加日志 2025-11-11 11:28:39 +08:00
lccsw d630126ed6 修改小程序我的统计条件 2025-11-11 10:42:28 +08:00
lccsw 4256057956 修改后台门店搜索 2025-11-11 10:06:23 +08:00
lccsw 5f78e382ac 修改客户列表操作日志 2025-11-10 20:10:05 +08:00
小鱼开发 1a6e692776 status 2025-11-10 17:36:40 +08:00
lccsw 41d318af60 日志增加门店类型筛选 2025-11-10 11:32:13 +08:00
小鱼开发 e5d4fdd55d statsu 2025-11-10 11:28:40 +08:00
lccsw c235500fc3 修改管理后台导出线索增加不解锁原因 2025-11-09 00:04:18 +08:00
lccsw 66d24d2912 修改埋点日志搜索 2025-11-08 23:43:58 +08:00
lccsw 0895cf366c 修改埋点 2025-11-08 23:41:05 +08:00
lccsw b677653340 小程序增加访问日志 2025-11-08 23:07:53 +08:00
lccsw 03fd97754e 修改用户认证 2025-11-06 22:53:55 +08:00
lcc efba822929 修改管理后台线索显示 2025-11-06 11:21:32 +08:00
lcc 044049dffd 修改获取线索城市 2025-11-06 11:06:51 +08:00
lcc cd5034f2ce 修改导出产品、报名城市默认值、导出线索 2025-11-05 22:58:24 +08:00
lcc 76f8099e2f 修改导出客户列表 2025-11-04 16:28:10 +08:00
lcc be0aa3191e 修改导出客户 2025-11-04 14:03:56 +08:00
lcc 68f12f9a77 修改导出客户 2025-11-04 11:37:16 +08:00
lcc a9d58d3d88 修改运营后台线索状态 2025-11-04 10:19:17 +08:00
lcc 3e77d71e94 修改管理后台导出接口和解锁状态显示 2025-11-04 09:02:42 +08:00
lcc 08ad9e899a 增加客户解锁增加解锁时间和后台解锁时间赛选 2025-11-02 11:49:54 +08:00
小鱼开发 e1d70e821d belong 2025-11-01 14:25:48 +08:00
lcc 9e8c0276c5 修改线索解锁流程 2025-10-31 11:12:29 +08:00
lcc aa3a900962 增加上传图片日志 2025-10-28 15:59:14 +08:00
lcc 6777b7be26 导出线索增加地区 2025-10-26 11:40:56 +08:00
lcc cebac1d493 修改商家解锁扣除佣金金额 2025-10-24 15:33:59 +08:00
lcc 679d3ba8dc 修改运营后台佣金接口 2025-10-24 15:16:53 +08:00
lcc dfa054beee 修改导出线索接口 2025-10-23 23:44:54 +08:00
lcc 11ad4f272c 修改导出线索接口 2025-10-23 23:42:21 +08:00
lcc e5f745b56e 修改空间站分配线索也需要解锁 2025-10-23 23:06:52 +08:00
lcc 11c036b22e 修改导出线索 2025-10-23 22:16:11 +08:00
lcc 6c354565a7 修改后台解锁判断 2025-10-23 17:21:23 +08:00
lcc 67f09bad18 修改产品状态接口 2025-10-21 16:12:23 +08:00
lcc 2d0d5c8f1e 修改删除派单门店方法 2025-10-21 15:14:15 +08:00
lcc 6e562dd473 修改线索导出 2025-10-21 10:31:39 +08:00
lcc dada72631e 修改线索导出 2025-10-21 10:23:23 +08:00
lcc aafe02aef1 增加线索导出接口 2025-10-21 10:03:05 +08:00
lcc 2622a02c68 修改产品列表限制城市 2025-10-21 08:52:05 +08:00
lcc ef4c1b50f5 运营后台过滤未解锁客户 2025-10-20 10:32:41 +08:00
lcc e739df6215 修改线索和客户解锁判断 && 增加导出接口 2025-10-20 09:36:40 +08:00
lcc 267ac52fb0 增加导出接口 2025-10-18 00:59:30 +08:00
lcc 8cf51caeec 修改报名brand_id 2025-10-17 21:24:12 +08:00
lcc c57d6f13ee 修改用户列表筛选条件 2025-10-17 17:08:08 +08:00
lcc 805a6bb91c 增加访问日志统计 2025-10-16 15:47:43 +08:00
lcc dbc9e8b204 增加产品排序 && 产品上架判断 2025-10-15 10:13:45 +08:00
lcc ad81194598 修改h5获取城市品牌 2025-10-14 23:34:25 +08:00
lcc 4dbe71093f 增加定位接口位置 2025-10-14 20:53:04 +08:00
lcc 0593748c11 修改配置 2025-10-13 11:36:39 +08:00
lcc bc133fb21e 灵活用工 2025-10-13 11:36:35 +08:00
lcc 1b679e2171 修改h5接口判断用户是否存在 2025-10-12 14:47:51 +08:00
lcc 36fed7a26d 门店4s列表显示品牌数据 && 修复错误日志报错 2025-10-12 09:52:38 +08:00
lcc f71509e7b6 替换文案 2025-10-11 14:45:44 +08:00
lcc 3903a6b421 替换文案 2025-10-11 14:39:22 +08:00
lcc 83c8b22fe4 调整产品setting表缓存时间 2025-10-10 17:01:18 +08:00
lcc f43f7f9c82 修改门店品牌修改后保存 2025-10-10 11:24:11 +08:00
lcc 4bc4fff673 修改4s品牌多选 2025-10-09 20:15:19 +08:00
lcc 9ac02180b7 开启自动分佣脚本 2025-10-09 17:03:51 +08:00
lcc 94e7bb0ca3 修改理车宝接口手机号脱敏和h5提交补贴信息短信通知 2025-10-05 10:28:58 +08:00
lcc 62dfc759c8 修改活动报名分配空间站流程 2025-09-30 16:57:56 +08:00
lcc 839a457182 管理后台增加用户操作日志 2025-09-18 17:11:35 +08:00
lcc ba34208fa2 增加管理员设置客服电话 2025-09-15 23:25:58 +08:00
lcc 9fc94f7426 修改后台接口 2025-09-15 15:28:59 +08:00
lcc 38538b9d80 修改外呼接口地址 2025-09-15 15:06:02 +08:00
lcc 30f3484d07 修改外呼配置信息 2025-09-15 14:51:47 +08:00
lcc 50f5957f09 修改外呼接口地址 2025-09-15 14:40:53 +08:00
lcc 54d7619864 调整运营后台线索拨打电话 2025-09-15 14:20:03 +08:00
lcc 0ccb255887 修改拨打电话限制门店类型 2025-09-15 14:20:02 +08:00
lcc 4651bae2ef 平安外呼系统 2025-09-15 14:20:01 +08:00
lcc 77e8748d2c 增加平安外呼系统 2025-09-15 14:19:58 +08:00
lcc f2fa987b7b 资料审核接口增加字段 2025-09-13 16:28:13 +08:00
lcc 2184f5e03c 运营后台补贴接口返回身份证 2025-09-13 09:22:28 +08:00
lcc 8f11b4bafa 替换文本内容 2025-09-12 17:10:31 +08:00
lcc b6803e64d4 修改样式 2025-09-11 22:30:01 +08:00
lcc 118a568db6 修改适用规则富文本 2025-09-11 17:02:37 +08:00
lcc 0d370d2d8e 修改文案显示 && 增加操作日志用户 && bug修复 2025-09-11 16:41:08 +08:00
lcc b8e1889615 修改短信验证码 2025-09-11 10:28:31 +08:00
lcc 7f4f2396c1 修复编辑产品推广范围bug 2025-09-09 17:55:20 +08:00
lcc e980dcadbc 替换旧的短信通道 2025-09-09 17:06:03 +08:00
lcc dc3f845085 切换短信通道 2025-09-09 15:21:14 +08:00
lcc f376aea414 修改优惠券详情接口 2025-09-09 15:13:28 +08:00
lcc 5de543103a 增加获取城市名首字母 && 优惠券内容说明 2025-09-09 11:12:47 +08:00
lcc d57858b6a7 修改机构用户 2025-09-08 14:49:39 +08:00
lcc aee2a4d647 修改运营后台用户管理 2025-09-08 14:49:38 +08:00
lcc af26635b37 新增补贴购车合同 && 保存推广bug && 小程序识别身份证 2025-09-07 15:28:55 +08:00
lcc 52f27d130d 修改产品列表返回值 2025-09-06 00:24:58 +08:00
lcc be8a28365c 修复bug 2025-09-05 17:22:02 +08:00
lcc 9ea8316762 删除没用字段 2025-09-05 17:08:15 +08:00
lcc fb6644364a 注释短信验证码 2025-09-02 11:39:12 +08:00
lcc e5b7ac5b6d 短信验证码 2025-09-02 11:39:11 +08:00
lcc 4760716ceb 增加代付接口 2025-09-02 11:39:02 +08:00
lcc aa7ad67280 修改好车补短信 2025-08-18 23:11:01 +08:00
lcc 9e2ed42c5e 调整运营后台用户管理 2025-08-15 14:10:13 +08:00
lcc 32b8397ac8 修复小程序接口看板数据和列表不一致 2025-08-11 17:23:43 +08:00
lcc 464730e199 修改管理后台客户列表筛选和增加字段 2025-08-10 22:46:09 +08:00
lcc 8efdea6181 修改分佣记录 2025-08-09 10:37:44 +08:00
lcc efa7da63d4 修改加载model 2025-08-09 09:53:14 +08:00
lcc 19bf45ac97 修改分佣脚本 2025-08-08 23:44:00 +08:00
lcc aa524a5cd8 修改小程序商余额日志时间格式 2025-08-08 14:09:54 +08:00
lcc db3e10663e 小程序接口战败客户移除cs_biz_id判断 2025-08-07 18:02:57 +08:00
lcc 9dab8fb8ad 修改h5产品列表和详情接口 2025-08-06 09:18:24 +08:00
lcc d97781842b 修改客户未分配,发短信通知脚本 2025-08-04 08:47:48 +08:00
lcc 485af70d5e 客户池列表增加操作日志 2025-08-01 19:21:46 +08:00
lcc 078f68fe49 注释自动脚本执行分佣 2025-08-01 14:07:03 +08:00
lcc fd1bfe09de 修改订单完结分佣 2025-08-01 14:02:30 +08:00
lcc e1f80d538e 修改订单完结分佣 2025-08-01 13:32:33 +08:00
lcc a671c09be7 修改分佣字段变量 2025-08-01 09:11:36 +08:00
lcc 0e7f9386d3 修改小程序4s店确定订单流程、后台增加cps金额、修改审核补贴扣除商家cps金额 2025-08-01 08:59:40 +08:00
lcc 36ba122e00 修复导入用户bug 2025-07-31 17:56:48 +08:00
lcc becd02dbb1 修改h5接口免授权 2025-07-31 16:02:08 +08:00
lcc bc525edd23 增加线索分佣脚本、管理后台增加操作日志、修改h5协议内容 2025-07-31 14:33:00 +08:00
lcc 432e8b0ef0 修改解锁线索流程、修改优惠券适用获取信息接口 2025-07-30 23:30:27 +08:00
lcc c1e5f45c6e 修改小程序接口增加未解锁线索 2025-07-30 14:59:36 +08:00
lcc 0524ecaabb 增加领取优惠券记录城市信息 2025-07-30 10:57:00 +08:00
lcc 9f4280292c 修改导入用户接口 2025-07-29 20:29:07 +08:00
lcc 1072885e6c 修改用户头像和个人信息接口 2025-07-29 17:35:46 +08:00
lcc be514021c5 修改导入用户默认团队id 2025-07-29 14:54:01 +08:00
lcc fee8749140 修改佣金显示层级 2025-07-29 14:35:04 +08:00
lcc 888dd482e1 修复运营后台导入用户城市不正确 2025-07-29 14:15:45 +08:00
小鱼开发 9d19b8cc1e e 2025-07-29 12:28:46 +08:00
lcc 36089e1968 修改用户接口 2025-07-29 08:53:31 +08:00
lcc de0ec3ecfd 修改微信配置 2025-07-28 10:36:43 +08:00
lcc 400479bf60 产品列表过滤非正常状态 2025-07-27 15:53:49 +08:00
lcc e049a0580f 修改运营后台免验证接口 2025-07-27 15:40:52 +08:00
lcc dd238fe4cc 设置common接口允许跨域 2025-07-27 15:23:55 +08:00
小鱼开发 6f767ee4e4 1 2025-07-27 15:04:09 +08:00
lcc 3e4b16e6c6 修改公共接口 2025-07-27 14:53:02 +08:00
lcc 437d3c4bdb 增加好车补后台和接口 2025-07-27 12:22:34 +08:00
小鱼开发 f8990ce8fd hdy 2025-07-26 16:52:42 +08:00
小鱼开发 2c827d8ad9 0712 2025-07-12 17:13:31 +08:00
小鱼开发 017fa128d4 0708 2025-07-08 16:04:20 +08:00
小鱼开发 096069243a 0705 2025-07-05 17:47:48 +08:00
小鱼开发 2b5a892c9f 0703 2025-07-03 16:10:03 +08:00
小鱼开发 e1ea03f14f 0703 2025-07-03 11:54:44 +08:00
小鱼开发 44634bc929 auto 2025-06-27 14:45:33 +08:00
小鱼开发 a98232c90e bill 2025-06-23 16:20:13 +08:00
小鱼开发 56dd4f7c87 bill 2025-06-23 15:56:31 +08:00
xiaoyu dc3f39f0b9 u_time 2025-06-19 15:19:48 +08:00
xiaoyu a607b4f9f9 biz 2025-06-19 09:36:10 +08:00
oofun 4ae27d3a22 sms 2025-06-13 18:19:55 +08:00
xiaoyu de69ca64a3 0504 2025-06-04 14:54:26 +08:00
xiaoyu 6eec72a0bd 0526 2025-05-26 16:29:56 +08:00
xiaoyu 673df6884c 0522 2025-05-22 14:36:07 +08:00
xiaoyu 9b88d884f5 0522 2025-05-22 14:24:25 +08:00
xiaoyu 5e0ecb7dde 0522 2025-05-22 14:18:10 +08:00
xiaoyu 652d821811 0520 2025-05-20 09:27:15 +08:00
xiaoyu ff45eab94e 1 2025-05-19 09:12:09 +08:00
xiaoyu 49bf7ba4ed 0518 2025-05-18 22:01:35 +08:00
xiaoyu ba0ffba9c3 0517 2025-05-17 17:39:23 +08:00
xiaoyu 026cb0dc53 0516 2025-05-16 18:08:48 +08:00
xiaoyu 2f2eb79ad9 0515 2025-05-15 14:54:42 +08:00
xiaoyu e4bd421f23 0514 2025-05-14 17:15:23 +08:00
xiaoyu bc0ef79587 0514 2025-05-14 17:11:47 +08:00
xiaoyu 1670863420 0514 2025-05-14 14:57:33 +08:00
xiaoyu 49a03cf29e 0514 2025-05-14 14:53:25 +08:00
xiaoyu bc78828cc0 score 2025-05-11 22:44:14 +08:00
xiaoyu 31b2d7047e 0511 2025-05-11 22:09:40 +08:00
xiaoyu 5a626de9a4 0509 2025-05-09 15:16:12 +08:00
xiaoyu 7084b8ca74 0509 2025-05-09 15:14:01 +08:00
xiaoyu d5d39ec07d 0509 2025-05-09 15:05:07 +08:00
xiaoyu 9be8fe0f6c 0507 2025-05-07 10:37:10 +08:00
xiaoyu 16b371c4dc 0506 2025-05-06 11:09:01 +08:00
xiaoyu d8a742a8f2 0506 2025-05-06 10:03:58 +08:00
xiaoyu 0213aa6516 0505 2025-05-05 13:51:20 +08:00
xiaoyu 791efc0182 belong 2025-05-04 17:26:57 +08:00
xiaoyu 9e3585ec45 belong 2025-05-04 17:23:47 +08:00
xiaoyu ecb7b35e69 0430 2025-04-30 13:56:30 +08:00
xiaoyu 066c511f1e 0429 2025-04-29 23:25:22 +08:00
xiaoyu 5781d599f8 0429 2025-04-29 23:23:10 +08:00
xiaoyu 93b58d95e9 0429 2025-04-29 23:18:44 +08:00
xiaoyu 1e8a7440ff 0429 2025-04-29 23:14:53 +08:00
xiaoyu 5d79f8f60e 0429 2025-04-29 22:56:44 +08:00
xiaoyu d0fae1161c 0426 2025-04-26 16:56:06 +08:00
xiaoyu ccc49f8420 0421 2025-04-21 10:14:35 +08:00
xiaoyu 20123e991a 0411 2025-04-11 10:40:29 +08:00
xiaoyu 9657106a13 411 2025-04-11 10:35:02 +08:00
xiaoyu e74679583b a 2025-04-11 10:09:40 +08:00
xiaoyu d304bff675 a 2025-04-11 10:07:45 +08:00
xiaoyu 39d6132104 0409 2025-04-09 10:57:39 +08:00
xiaoyu e49091c9cf 0406 2025-04-06 14:47:53 +08:00
xiaoyu 8ff27127a1 0406 2025-04-06 11:19:44 +08:00
xiaoyu 04c7e1b529 0406 2025-04-06 11:14:42 +08:00
xiaoyu 1f68bd2095 0406 2025-04-06 11:13:15 +08:00
xiaoyu 2f91944191 0406 2025-04-06 10:26:56 +08:00
lcc fa2822b4ab 修改element-ui资源文件 2025-03-31 18:00:31 +08:00
xiaoyu 990d21cff7 autohome 2025-03-26 10:18:29 +08:00
xiaoyu 4a5a7ea5ce autohome 2025-03-21 09:58:47 +08:00
xiaoyu e49d80b007 1 2025-03-17 19:30:42 +08:00
lcc 34ccbe0de4 修改该评分客户跟进限制 2025-03-16 21:11:13 +08:00
xiaoyu cb36035f72 piac 2025-03-14 16:56:26 +08:00
lcc ab2c17ed1a 增加平安用户端增加退出 2025-03-14 16:37:30 +08:00
xiaoyu 27ac5aab3f piac 2025-03-14 15:20:04 +08:00
xiaoyu a985cf1c53 piac 2025-03-14 15:18:11 +08:00
xiaoyu 4eed171b44 c 2025-03-13 17:41:34 +08:00
lcc 75c8db21c9 限制省份 2025-03-13 12:07:41 +08:00
lcc 865a1632d4 bug修复 2025-03-12 17:42:30 +08:00
xiaoyu 4ef80454f2 p 2025-03-12 17:38:56 +08:00
xiaoyu 02d2dc0a4e p 2025-03-12 17:33:11 +08:00
xiaoyu 24aba0a738 p 2025-03-12 17:27:43 +08:00
xiaoyu 0810c328d0 p 2025-03-12 16:54:54 +08:00
lcc 548a5b73af 平安用户端 2025-03-12 10:35:39 +08:00
xiaoyu 7958cccde5 p 2025-03-11 16:21:39 +08:00
xiaoyu 6fe79d9bad p 2025-03-11 16:12:58 +08:00
xiaoyu 97eff531e8 p 2025-03-11 15:31:29 +08:00
xiaoyu b63dfdaaf3 area 2025-03-08 16:45:21 +08:00
xiaoyu e3237532fe area 2025-03-08 16:37:23 +08:00
xiaoyu dc4885c449 cars 2025-03-07 23:01:46 +08:00
xiaoyu ddc48d9f37 cars 2025-03-07 22:36:50 +08:00
xiaoyu 42845d0628 cars 2025-03-07 22:34:51 +08:00
xiaoyu a74a529a0d cars 2025-03-07 22:29:18 +08:00
xiaoyu 8784d8a1ed Merge branch 'master' of http://git2.haodian.cn/lcc/spacestation 2025-03-07 22:18:41 +08:00
xiaoyu 3ae447dfa5 cars 2025-03-07 22:18:19 +08:00
lcc 954a7778b9 增加home目录 2025-03-07 17:58:20 +08:00
xiaoyu 50b7afb8f3 10494 2025-03-03 09:27:46 +08:00
xiaoyu 39ec4cec06 10494 2025-03-02 23:14:56 +08:00
xiaoyu e4dbf9c3e1 a 2025-02-24 00:39:54 +08:00
xiaoyu 102b8c4d38 21 2025-02-21 18:01:36 +08:00
xiaoyu 9ccf50cfaa biz 2025-02-21 14:13:30 +08:00
xiaoyu 7db6a05187 cfrom 2025-02-21 10:13:52 +08:00
xiaoyu 949d921d56 cfrom 2025-02-21 09:55:02 +08:00
xiaoyu 5d914c94a9 cfrom 2025-02-21 09:53:55 +08:00
xiaoyu 7a2f083199 cfrom 2025-02-21 09:52:52 +08:00
lcc 0c5305782c 增加线索列表和导出更新时间和T+1扣分项 2025-02-19 17:54:27 +08:00
xiaoyu 03f899c964 ad 2025-02-18 14:26:16 +08:00
lcc e6bae96521 修改返回私域专题报名状态 2025-02-12 21:10:51 +08:00
xiaoyu f049baa929 10492 2025-02-10 14:39:56 +08:00
xiaoyu 845a71f647 channel 2025-02-08 10:51:06 +08:00
xiaoyu c9de0570da channel 2025-02-07 15:44:53 +08:00
lcc 9715dd46f0 修复后台分配线索时间没更新 2025-02-07 15:42:37 +08:00
xiaoyu 92d982f0bf p_time 2025-02-07 14:19:29 +08:00
xiaoyu 5ade66714c p_time 2025-02-07 14:17:43 +08:00
xiaoyu eb9ba12e8f clues 2025-01-22 15:54:04 +08:00
xiaoyu 6bb2b4d8dd clues 2025-01-22 15:51:56 +08:00
lcc fe14ed68f2 修改后台 2025-01-20 16:53:57 +08:00
lcc 3216159ba8 修改报表 2025-01-20 10:28:29 +08:00
lcc 1efdd96a09 修改统计店铺类型 2025-01-20 08:47:45 +08:00
xiaoyu e8b77b971b biz 2025-01-19 22:13:42 +08:00
lcc 72e77c37e3 门店增加类型 2025-01-19 17:04:24 +08:00
xiaoyu ad6e27f8dd clues 2025-01-17 15:13:26 +08:00
xiaoyu f2ccebcba0 order 2025-01-17 14:43:26 +08:00
lcc 4e1f72b2eb 增加线索跟进人筛选 2025-01-15 10:48:12 +08:00
lcc f60943484e 增加线索分配 2025-01-14 17:49:34 +08:00
lcc 104cb670aa 修改日报数据脚本 2025-01-13 16:49:22 +08:00
xiaoyu 9633771069 123 2025-01-12 09:27:36 +08:00
xiaoyu 8d199628a4 0110 2025-01-10 14:22:16 +08:00
lcc c8a7a89175 修改日报脚本 2025-01-10 11:20:11 +08:00
lcc 1ff604d5e6 修改日报脚本 2025-01-10 11:05:46 +08:00
xiaoyu 7f3bc35be2 report 2025-01-09 09:30:33 +08:00
lcc 95a58722c1 增加月开工率 2025-01-08 16:04:19 +08:00
lcc c596574bb2 增加月开工率 2025-01-08 15:59:19 +08:00
lcc d86c7ba50a 增加月开工率 2025-01-08 15:50:24 +08:00
lcc 65c3031fc8 增加月开工率 2025-01-08 15:28:25 +08:00
lcc 1148b91500 修改日报 2025-01-08 10:16:27 +08:00
lcc c202e34091 后台增加门店日报 2025-01-08 08:03:58 +08:00
xiaoyu 6fbde3c97b channel 2025-01-07 16:31:36 +08:00
xiaoyu fd1b8a8efe 1 2024-12-31 23:58:44 +08:00
xiaoyu c63d698f51 1 2024-12-31 23:36:22 +08:00
xiaoyu ddda4655f5 bill 2024-12-24 15:31:56 +08:00
xiaoyu c017f47b17 bill 2024-12-24 13:50:58 +08:00
xiaoyu dcc9937edd bill 2024-12-24 13:46:42 +08:00
xiaoyu 1fbe387f2b img 2024-12-21 17:30:01 +08:00
xiaoyu 67e703a78e 1 2024-12-21 10:44:26 +08:00
lcc 84989dbaed 修复bug 2024-12-20 14:52:41 +08:00
lcc 2c591655ac 修改cps品牌 2024-12-20 14:09:16 +08:00
lcc 9ccbffa083 增加cps品牌和bootstrap-select搜索插件 2024-12-19 08:22:43 +08:00
lcc 865e00f8ef 修改客户导出 2024-12-17 08:13:53 +08:00
lcc c3f59dc96c 增加短信登录和后台客户电话显示 2024-12-16 17:32:21 +08:00
xiaoyu 70aa371427 1 2024-12-13 15:54:07 +08:00
xiaoyu 3c8e6badec t 2024-12-12 17:45:42 +08:00
xiaoyu 6452f23de8 t 2024-12-12 15:20:24 +08:00
xiaoyu ccbcb771f8 t 2024-12-12 15:13:34 +08:00
xiaoyu 1b139b934f t 2024-12-12 15:03:52 +08:00
xiaoyu 28bc1aafbd t 2024-12-12 15:01:07 +08:00
xiaoyu efa597f31a 1 2024-12-11 10:55:34 +08:00
xiaoyu a5c63f7494 fixed 2024-12-07 18:35:34 +08:00
xiaoyu b2ff331c61 brand 2024-12-07 18:18:29 +08:00
xiaoyu 478e7bbe4f brand 2024-12-07 18:17:09 +08:00
xiaoyu 6ba01cf151 ac 2024-12-07 16:29:17 +08:00
lcc 593c8edc3f 1 2024-12-07 11:44:54 +08:00
lcc e26f9ad6ad 后台-修改客户和订单显示条件 2024-12-07 11:37:00 +08:00
lcc e37dbb55be 客户列表和详情增加关注车型 2024-12-07 08:41:29 +08:00
lcc eff94cbd14 修改客户筛选 2024-12-06 09:27:24 +08:00
lcc d74ee00999 后台增加管理员门店限制 2024-12-06 09:27:24 +08:00
xiaoyu b29593922d clue 2024-12-05 11:25:59 +08:00
xiaoyu 2f5a8f30f7 report 2024-12-04 13:59:35 +08:00
xiaoyu 26e986d26a report 2024-12-04 13:57:32 +08:00
xiaoyu 1167490381 report 2024-12-04 13:21:21 +08:00
xiaoyu 85bd70c535 report 2024-12-04 13:11:09 +08:00
xiaoyu a9fd2297d7 report 2024-12-04 13:09:00 +08:00
xiaoyu b51eeb3982 report 2024-12-04 13:07:48 +08:00
xiaoyu d0b2316758 report 2024-12-04 13:06:27 +08:00
xiaoyu 6b1b91d679 Merge branch 'master' of http://git2.haodian.cn/lcc/spacestation 2024-12-03 15:42:30 +08:00
xiaoyu f4b54cb88f 1 2024-12-03 15:42:22 +08:00
lcc 8e31f9133a 修复评分脚本bug 2024-12-02 21:11:15 +08:00
lcc 4b4db5b3fb 修复评分脚本bug 2024-12-02 19:57:59 +08:00
xiaoyu badcd40f40 1 2024-12-02 15:03:57 +08:00
xiaoyu 069850afc5 1 2024-11-30 18:37:30 +08:00
xiaoyu d9d4ce7c28 2 2024-11-30 17:07:32 +08:00
xiaoyu 173a32c0e1 2 2024-11-30 17:06:18 +08:00
xiaoyu c54ab4384f 12 2024-11-29 18:31:45 +08:00
xiaoyu 4a6ed71583 12 2024-11-29 18:29:49 +08:00
xiaoyu 9bcd2cacff 12 2024-11-29 18:27:55 +08:00
xiaoyu 5409d83eb9 11 2024-11-28 21:53:30 +08:00
xiaoyu 2d5a5cb6e1 1 2024-11-28 18:08:20 +08:00
xiaoyu de846bea43 4 2024-11-28 11:50:20 +08:00
xiaoyu fabd4da672 4 2024-11-28 11:45:16 +08:00
lcc 03d3b2549b 增加input搜索 2024-11-26 22:27:14 +08:00
lin fan 92dcf56e22 s 2024-11-26 15:41:11 +08:00
lin fan ab07e0d6d7 1 2024-11-26 10:45:12 +08:00
lin fan 7b1c748e7c 1 2024-11-25 23:37:46 +08:00
lin fan bb56705f63 1 2024-11-24 19:23:20 +08:00
lin fan 5d3da9d84a 1 2024-11-24 00:19:01 +08:00
lin fan 5f84d59dd4 fixed 2024-11-23 16:54:37 +08:00
lin fan ab83c08f21 3 2024-11-23 14:44:56 +08:00
lin fan f5615e8532 3 2024-11-23 14:32:48 +08:00
lin fan a795d76963 3 2024-11-23 11:53:49 +08:00
lin fan 5cac57e217 123 2024-11-23 11:35:12 +08:00
lin fan baeef5b45b 123 2024-11-23 11:21:36 +08:00
lin fan b065c324c2 123 2024-11-23 09:50:52 +08:00
lin fan c47dc30b69 1 2024-11-22 20:48:25 +08:00
lin fan fc91fb1b57 1 2024-11-22 20:45:15 +08:00
lin fan 49d257c930 1 2024-11-22 20:34:37 +08:00
lin fan 860d6b069e 1 2024-11-22 20:18:57 +08:00
lin fan cf75187ca8 1 2024-11-22 20:14:58 +08:00
lin fan 251834304e 1 2024-11-22 20:11:07 +08:00
lin fan e677eebaf6 1 2024-11-22 20:07:37 +08:00
lin fan 042134f2b6 1 2024-11-22 20:06:29 +08:00
lin fan bf11e496c6 1 2024-11-22 18:20:39 +08:00
lin fan c35660e43a 1 2024-11-22 17:51:32 +08:00
lin fan bf5bd4724b 1 2024-11-22 17:43:33 +08:00
lin fan 45e91dc45a 1 2024-11-22 17:20:43 +08:00
lin fan 01d0907bfc 1 2024-11-22 17:03:58 +08:00
lin fan 797108edfb 1 2024-11-22 14:56:53 +08:00
lin fan 579b656dc7 1 2024-11-22 09:39:18 +08:00
lin fan 15db41dc90 1 2024-11-21 17:10:31 +08:00
lin fan 4d6b91e196 1 2024-11-21 17:07:56 +08:00
lin fan 51b07fe245 1 2024-11-21 17:05:28 +08:00
lin fan 1805867954 1 2024-11-21 17:02:23 +08:00
lin fan d3d48529b6 1 2024-11-21 17:00:15 +08:00
lin fan 385f89098c 1 2024-11-21 16:43:52 +08:00
lin fan 02f57eec44 1 2024-11-21 16:42:50 +08:00
lin fan 6556f015df 1 2024-11-21 16:40:38 +08:00
lin fan 8c920464b5 1 2024-11-21 16:24:21 +08:00
lin fan d48c0e977a 1 2024-11-21 16:03:12 +08:00
lin fan 9a2d3a46b4 1 2024-11-21 16:00:34 +08:00
lin fan 8b023aa8ff 1 2024-11-21 15:52:40 +08:00
lin fan f6f84a07a2 1 2024-11-21 15:25:39 +08:00
lin fan 44908921d2 1 2024-11-21 15:19:40 +08:00
lin fan 518f59da42 1 2024-11-21 15:19:04 +08:00
lin fan c8e3ae6d8c 1 2024-11-21 15:18:02 +08:00
lin fan 7d22016c69 1 2024-11-21 15:02:41 +08:00
lin fan d6e7cdca85 1 2024-11-21 14:56:06 +08:00
lin fan 6329032278 1 2024-11-21 11:23:03 +08:00
lin fan 3997c42926 1 2024-11-21 11:16:45 +08:00
lin fan ddbc7de320 1 2024-11-12 16:42:51 +08:00
lin fan a217c47707 fixed 2024-11-11 21:16:25 +08:00
lin fan c2bf584746 fixed 2024-11-11 20:57:01 +08:00
lin fan c69c9b66d9 1 2024-11-10 23:16:59 +08:00
lin fan 41064c1db4 1 2024-11-10 22:58:48 +08:00
lin fan 9abecbf9dd 1 2024-11-10 22:56:59 +08:00
lin fan 39531bb665 1 2024-11-10 22:54:55 +08:00
lin fan 5a14a6b9c9 1 2024-11-10 22:53:34 +08:00
lin fan a29d7f4e55 bug 2024-11-10 17:20:10 +08:00
lin fan 19981785e6 1 2024-11-09 15:46:37 +08:00
lin fan 03f6cb9275 12 2024-11-08 09:31:44 +08:00
lin fan db34c86686 1 2024-11-07 22:53:29 +08:00
lin fan 516ddf74ab Merge branch 'master' of http://git2.haodian.cn/lcc/spacestation 2024-11-07 22:45:45 +08:00
lin fan a4093c83e7 1 2024-11-07 22:44:54 +08:00
lin fan a12ff7f1d6 1 2024-11-07 09:59:17 +08:00
lcc fbdc628e9a 增加over_time更新 2024-11-06 18:02:54 +08:00
lin fan a57b1543c2 fixed 2024-11-06 16:20:38 +08:00
lin fan 28ff3dfc54 fixed 2024-11-06 15:51:40 +08:00
lin fan c7f377c66f fixed 2024-11-06 15:49:45 +08:00
lin fan b22bcc77fd Merge branch 'master' of http://git2.haodian.cn/lcc/spacestation 2024-11-06 15:09:06 +08:00
lin fan 0926f40ee3 12 2024-11-06 15:08:57 +08:00
lcc 3389ab972d 调整接口统计 2024-11-05 10:43:07 +08:00
lin fan bfabe9012e 1 2024-11-04 23:15:02 +08:00
lin fan 8a4d298ec9 1 2024-11-04 23:06:46 +08:00
lin fan 8466fe42ca 1 2024-11-04 22:43:13 +08:00
lin fan 713b6acd59 1 2024-11-04 22:21:38 +08:00
lin fan dd3f52ff78 1 2024-11-04 21:47:50 +08:00
lin fan bfeadbd633 1 2024-11-04 21:03:46 +08:00
lin fan b88f5eaf10 1 2024-11-04 19:05:44 +08:00
lin fan cab799d3d7 1 2024-11-04 18:56:27 +08:00
lin fan a1b9be51eb 1 2024-11-04 18:54:01 +08:00
lin fan e103f9dd04 1 2024-11-04 17:41:50 +08:00
lin fan 90d572cd8c 1 2024-11-04 17:37:15 +08:00
lin fan 6258035e52 Merge branch 'master' of http://git2.haodian.cn/lcc/spacestation 2024-11-04 17:31:06 +08:00
lin fan 34099e1292 1 2024-11-04 17:27:34 +08:00
lcc f00a666828 增加脚本 2024-11-04 10:19:45 +08:00
lcc e346e8e84a 修改数据 2024-11-03 20:31:58 +08:00
lcc 8722cd7d29 修改评分 2024-11-03 19:47:50 +08:00
lcc a537452c19 修改评分 2024-11-03 18:35:27 +08:00
lcc 20e02dbf30 修改评分 2024-11-03 18:16:32 +08:00
lcc 797d7e7d0a 修改评分 2024-11-03 17:41:36 +08:00
lcc 5daeda5bb9 五边形评分 2024-11-02 17:50:44 +08:00
lcc 5785dd2ab1 修改评分 2024-10-26 23:20:10 +08:00
lcc 97653c95cf 修改评分统计 2024-10-25 17:25:24 +08:00
lcc 35732ebbef fixed 2024-10-24 17:38:12 +08:00
lcc 50f4fcc25e 增加电话评分类型 2024-10-24 14:16:41 +08:00
lcc 0979b2f359 修改评分 2024-10-24 09:31:54 +08:00
lcc e44ed4aaa0 修改积分脚本 2024-10-24 09:26:52 +08:00
lcc 4f98e1f629 修改积分统计 2024-10-22 17:06:38 +08:00
lin fan 9f294133e2 1 2024-10-22 09:39:03 +08:00
lcc 5fe529d06d 修改分数详情接口 2024-10-21 14:45:21 +08:00
lcc 8e977823de 修改门店分数排行按省 2024-10-21 10:57:14 +08:00
lcc 4dbcd7956a 添加记录任务 2024-10-19 09:59:17 +08:00
lcc d1ac341494 fixed 2024-10-18 17:35:26 +08:00
lcc d5dbaca67b fixed 2024-10-18 16:17:09 +08:00
lcc be18ac159a fixed 2024-10-18 15:15:44 +08:00
lcc ea7e443e07 1 2024-10-18 15:09:17 +08:00
lcc 6749112a55 修改分数统计脚本 2024-10-18 14:25:14 +08:00
lcc a30bcfe1d8 fixed 2024-10-17 15:36:33 +08:00
lcc 0831d82455 删除测试代码 2024-10-17 15:32:37 +08:00
lcc 4a82ee0294 修改配置 2024-10-17 14:58:45 +08:00
lcc 6bfd03c33c 增加评分 2024-10-17 13:18:32 +08:00
lcc 2bef6925a9 修改客户和订单 2024-09-26 17:55:06 +08:00
小鱼开发 e480d2e43b 923 2024-09-23 11:29:33 +08:00
lcc 4f4a873781 修改后台云信号码分配 2024-09-04 15:13:37 +08:00
lcc a6dc8037bf 增加晓致虚拟电话 2024-09-04 15:13:37 +08:00
lcc 9e0385630c 修改客户品牌 2024-09-02 18:07:15 +08:00
小鱼开发 30e554a5a2 1 2024-08-29 10:14:08 +08:00
小鱼开发 cf5dd6d79e 0826 2024-08-26 15:14:46 +08:00
小鱼开发 95cdf599ad 1 2024-08-25 15:33:47 +08:00
小鱼开发 64a9e93a55 0817 2024-08-17 15:19:04 +08:00
小鱼开发 277c225459 0815 2024-08-15 18:10:45 +08:00
小鱼开发 3c00bfa053 1 2024-08-15 16:22:13 +08:00
小鱼开发 e39df3bc6d 1 2024-08-15 15:39:10 +08:00
小鱼开发 334084a61b 1 2024-08-15 15:25:21 +08:00
小鱼开发 1b76186a6b 1 2024-08-15 15:22:09 +08:00
lcc b78dbf8c5f 修改获取门店信息接口 2024-08-11 18:25:32 +08:00
lcc af4776ca68 增加门店查询接口 2024-08-08 16:35:13 +08:00
lcc a97d8cf300 增加状态查询接口 2024-08-08 11:45:51 +08:00
lcc a76f07ba87 增加添加线索接口 2024-08-07 17:46:06 +08:00
小鱼开发 4ce66aab91 213 2024-08-05 16:47:04 +08:00
小鱼开发 f5f4349d7c wxgr 2024-08-04 17:38:45 +08:00
小鱼开发 a46ac7dddd wxgr 2024-08-04 17:36:00 +08:00
小鱼开发 c5053ea7e4 1 2024-07-27 16:39:27 +08:00
小鱼开发 11c8548edd 7.22 2024-07-22 10:00:08 +08:00
小鱼开发 dc552fe84d brand 2024-07-20 15:18:17 +08:00
小鱼开发 f407a26edf 1 2024-07-19 21:54:47 +08:00
小鱼开发 e5a53169a9 1 2024-07-19 21:48:49 +08:00
小鱼开发 45702fae89 1 2024-07-19 21:46:36 +08:00
小鱼开发 b8cbb8d3dd cus 2024-07-18 17:38:42 +08:00
小鱼开发 8f9f8010de cus 2024-07-18 17:05:41 +08:00
小鱼开发 4717118b65 c_time 2024-07-17 16:36:48 +08:00
小鱼开发 d1b7cd55b2 c_time 2024-07-17 16:01:41 +08:00
小鱼开发 98e9f8ebfb order 2024-07-16 19:06:22 +08:00
lcc 73a026c859 修改图片上传 2024-07-16 14:48:54 +08:00
小鱼开发 88ada419c7 715 2024-07-15 19:11:43 +08:00
37044 changed files with 3825998 additions and 2846 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
@@ -58,7 +58,7 @@ $autoload['packages'] = array();
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database');
$autoload['libraries'] = array('database', 'myResponse');
/*
| -------------------------------------------------------------------
@@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('comm', 'sys', 'url','image');
$autoload['helper'] = array('comm', 'sys', 'url', 'image', 'authorization');
/*
| -------------------------------------------------------------------
+22
View File
@@ -94,3 +94,25 @@ $db['default'] = array(
'failover' => array(),
'save_queries' => TRUE
);
$db['agentdb'] = array(
'dsn' => '',
'hostname' => 'mysql:host=127.0.0.1;port=3306;dbname=agentdb',
'username' => 'devuser',
'password' => 'DEV@hdy123456',
'database' => 'agentdb',
'dbdriver' => 'pdo',
'dbprefix' => 'lc_',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
+12
View File
@@ -0,0 +1,12 @@
<?php
/**
* websocket配置文件
*/
defined('BASEPATH') or exit('No direct script access allowed');
$config['url'] = "wss://sapi.liche.cn/wss";
$config['jwt_key_pingan'] = 'dvsr23423vsgAEDger'; //平安端生成用户秘钥
$config['jwt_key_system'] = '2343ljfwefefew';//后端生成用户秘钥
$config['jwt_algorithm'] = 'HS256';
+151 -44
View File
@@ -72,6 +72,7 @@ class Common extends CI_Controller
$id = intval($this->input->get('id'));
$url = $this->input->get('url');
$type = intval($this->input->get('type'));
$province_limit = $this->input->get('province_limit');
$this->load->model('area_model');
switch ($key) {
@@ -79,7 +80,8 @@ class Common extends CI_Controller
if ($url == 'search') {
$province = $this->filter($this->area_model->province());
} else {
$province = $this->area_model->province();
$province_limit = $province_limit ? true : false;
$province = $this->area_model->province($province_limit);
}
$this->data = $province;
break;
@@ -413,9 +415,12 @@ class Common extends CI_Controller
$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'));
$car_brand_id = intval($this->input->post('car_brand_id'));
$province_id = intval($this->input->post('province_id'));
$city_id = intval($this->input->post('city_id'));
$county_id = intval($this->input->post('county_id'));
$type = $this->input->post('type');
$unset_city_limit = intval($this->input->post('unset_city_limit'));
$use_shop_list = $this->input->post('use_shop_list');
$sys_cate_id = intval($this->input->post('sys_cate_id'));
@@ -428,6 +433,7 @@ class Common extends CI_Controller
}
}
$where['status'] = 1;
// $car_brand_id && $where['car_brand_id'] = $car_brand_id;
$sys_cate_id && $where['cate_id'] = $sys_cate_id;
$biz_name && $where['biz_name like "%' . $biz_name . '%"'] = null;
$brand_id && $where['brand_id'] = $brand_id;
@@ -435,8 +441,16 @@ class Common extends CI_Controller
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;;
$ids && $where['id not in (' . $ids . ')'] = null;
if (is_array($type)) {
$type && $where['type in (' . implode(',', $type) . ')'] = null;
} else {
$type == 1 && $where['type'] = 1;
}
if ($car_brand_id) {
$where["id in (select biz_id from lc_biz_car_brand where brand_id={$car_brand_id})"] = null;
}
if ($province_id && $city_id) {
if (($province_id && $city_id) || $unset_city_limit) {
$count = $this->mdBiz->count($where);
if ($count) {
$resBiz = $this->mdBiz->select($where, 'id desc', $page, $size);
@@ -445,6 +459,10 @@ class Common extends CI_Controller
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['name'] = $value['biz_name'];
if (is_array($type)) {
$bizType = $this->mdBiz->type_ary($value['type']);
$setValue['name'] .= '(' . $bizType . ')';
}
$img = $value['headimg'] ? $value['headimg'] : $value['cover'];
$setValue['img'] = $img ? build_qiniu_image_url($img) : '';
$setValue['sort'] = $key;
@@ -832,7 +850,11 @@ class Common extends CI_Controller
*/
public function bind_mobile()
{
$this->load->helper('order');
$this->load->model('receiver/receiver_call_wechat_model', 'callWechat');
$this->load->library('carHome/callOutWechat');
$this->load->model('sys/sys_admin_model');
$this->load->model('sys/sys_yx_mobiles_model');
$params = $this->input->get();
$id = intval($params['id']);
$type = $params['type'];
@@ -843,55 +865,89 @@ class Common extends CI_Controller
if ($type == 'clues') {
$this->load->model('receiver/receiver_clues_model', 'mdClues');
$re = $this->mdClues->get(array('id' => $id));
$orderId = $re['sid'];
$cfId = $re['id'];
$cfType = Receiver_call_wechat_model::CF_TYPE_CLUE;
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
$orderId = $re['cid'];
$cfId = $re['id'];
$cfType = Receiver_call_wechat_model::CF_TYPE_CUSTOMERS;
} else {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '手机不存在!');
}
$user = $this->sys_admin_model->get(['id' => $this->uid]);
$user_mobile = $user['kf_mobile'] ?: $user['mobile'];
if (!$user_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];
$callOutWechat = new CallOutWechat();
$cityId = $re['city_id'] ?: 350200;
$requestId = create_order_no($cityId, 'licheb');
$req = $callOutWechat->outBind($requestId, $orderId, $user_mobile, $mobile);
if (!$req->isSuccess()) {
return $this->show_json(SYS_CODE_FAIL, $req->getMessage());
}
if (!$middleNumber) {
return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
//添加记录
$add_data = [
'reqId' => $requestId,
'cfId' => $cfId,
'cfUid' => $this->uid,
'cfType' => $cfType,
'cfPlatform' => Receiver_call_wechat_model::CF_PLATFORM_ADMIN,
'createTime' => time()
];
$req = $this->callWechat->add($add_data);
if (!is_numeric($req)) {
return $this->show_json(SYS_CODE_FAIL, $req->getMessage());
}
$this->load->helper('order');
require_once COMMPATH . 'third_party/Ycall/Ycall.php';
$seq_id = create_order_no();
$ycall = new Ycall();
$maxBindingTime = 30;//绑定时间
$result = $ycall->AXbind($middleNumber, $mobile, '', $maxBindingTime, '');
//绑定手机号
return $this->show_json(SYS_CODE_SUCCESS, '提交成功,请耐心等待');
// $cache = &load_cache('redis');
// $xz_admin_phone = $cache->get('xz_admin_phone');
// $middleNumber = '';
// if ($xz_admin_phone) {
// $middleNumber = $xz_admin_phone['admins'][$this->uid];
// }
// 平安双呼
// $yxMobiles = $this->sys_yx_mobiles_model->get(['admin_id' => $this->uid, 'status' => 1]);
// $middleNumber = $yxMobiles['mobile'] ?: '';
// if (!$middleNumber) {
// return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
// }
// require_once COMMPATH . 'third_party/Ycall/Ycall.php';
// $seq_id = create_order_no();
// $ycall = new Ycall();
// $maxBindingTime = 30;//绑定时间
// $result = $ycall->AXbind($middleNumber, $mobile, '', $maxBindingTime, '');
//改AXB模式 开始
// $this->load->model('sys/sys_admin_model');
// $user = $this->sys_admin_model->get(['id'=>$this->uid]);
// $user_mobile = $user['mobile'];
// if(!$user_mobile) return $this->show_json(SYS_CODE_FAIL, '管理员未设置手机号');
// $result = $ycall->ABXbind($user_mobile, $mobile, $seq_id, $maxBindingTime);
//改AXB模式 结束
if ($result['result'] != '000000') { //绑定失败
debug_log("xz_result:" . json_encode($result, JSON_UNESCAPED_UNICODE));
return $this->show_json(SYS_CODE_FAIL, $result['message']);
}
$this->data['middlenumber'] = $result['middleNumber'];
$add_data = [
'call_id' => $seq_id,
'bind_id' => $result['bindId'],
'display_number' => $result['middleNumber'],
'cf_id' => $id,
'cf_uid' => $this->uid,
'cf_title' => $type,
'cf_platform' => 'admin',
'c_time' => time()
];
$this->mdReceiverYx->add($add_data);
$this->data['mobile_sub'] = mobile_asterisk($mobile);
$this->data['id'] = $id;
$this->show_view('common/bind_mobile');
// if ($result['result'] != '000000') { //绑定失败
// debug_log("xz_result:" . json_encode($result, JSON_UNESCAPED_UNICODE));
// return $this->show_json(SYS_CODE_FAIL, $result['message']);
// }
// $this->data['middlenumber'] = $result['middleNumber'];
// $add_data = [
// 'call_id' => $seq_id,
// 'bind_id' => $result['bindId'],
// 'display_number' => $result['middleNumber'],
// 'cf_id' => $id,
// 'cf_uid' => $this->uid,
// 'cf_title' => $type,
// 'cf_platform' => 'admin',
// 'c_time' => time()
// ];
// $this->mdReceiverYx->add($add_data);
// $this->data['mobile_sub'] = mobile_asterisk($mobile);
// $this->data['id'] = $id;
// $this->show_view('common/bind_mobile');
}
/**
@@ -1095,10 +1151,10 @@ class Common extends CI_Controller
$count = $this->auto_brand_model->count($where);
$itemsList = [];
if ($count) {
$lists = $this->auto_brand_model->select($where, 'id desc', $page, $size);
$lists = $this->auto_brand_model->select($where, 'initial asc', $page, $size);
foreach ($lists as $key => $val) {
$itemsList[] = [
'id' => $val['id'],
'id' => intval($val['id']),
'name' => $val['name'],
'is_checked' => $itemsChecked[$val['id']] ? 1 : 0
];
@@ -1135,7 +1191,7 @@ class Common extends CI_Controller
if ($type == 1) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
$res = array();
$rows = $this->mdAutoBrand->select($where, 'status desc, id asc', 0, 0, 'id,name');
$rows = $this->mdAutoBrand->select($where, 'initial asc', 0, 0, 'id,name');
foreach ($rows as $v) {
$res[] = array(
'id' => strlen($status) > 0 ? $v['id'] : " " . $v['id'],
@@ -1144,16 +1200,67 @@ class Common extends CI_Controller
}
} else if ($type == 2) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id asc', 0, 0, 'id,name');
} else if ($type == 3) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车型');
$res = $this->mdAutoCar->select(array_merge($where, ['series_id' => $pid]), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoCar->select(array_merge($where, ['series_id' => $pid]), 'id asc', 0, 0, 'id,name');
}
foreach ($res as $key => $value) {
foreach ($res as $value) {
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
}
$this->data = $lists;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function auto_search()
{
$name = $this->input->get('name');
$lists = [];
if ($name) {
$where = array(
"name like '%{$name}%'" => null,
"status" => 1
);
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$res = $this->mdAutoBrand->select($where, '', 0, 0, 'id,name');
foreach ($res as $value) {
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
}
}
$this->data = $lists;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function get_paic_users()
{
$this->load->model('app/paic/app_paic_users_model');
$where = [
'status' => App_paic_users_model::STATUS_NORMAL
];
$rows = $this->app_paic_users_model->select($where, 'id desc', 0, 0, 'id,name,mobile');
foreach ($rows as $k => $v) {
$rows[$k]['name'] = $v['name'] . " (" . substr($v['mobile'], -4) . ")";
}
$this->data = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function set_notice()
{
$id = $this->input->post('id');
$this->load->model('sys/sys_notice_model');
if ($this->uid) {
$where = ['uid' => $this->uid, 'platform' => Sys_notice_model::PLAT_FORM_ADMIN];
if ($id) {
$where['id'] = $id;
}
$this->sys_notice_model->update(['read' => Sys_notice_model::STATUS_READ], $where);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
}
+8 -5
View File
@@ -140,7 +140,9 @@ 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, $code);
// send_sms($mobile, $code);
$content = "【好店云(厦门)科技】" . "您的验证码为:{$code},请勿泄露于他人!";
b2m_send_sms($mobile,$content);
}
}
@@ -216,10 +218,11 @@ class Login extends CI_Controller
//退出
public function logout()
{
$domain = explode('.', $_SERVER['HTTP_HOST']);
array_shift($domain);
$domain = implode('.', $domain);
// $domain = explode('.', $_SERVER['HTTP_HOST']);
// array_shift($domain);
// $domain = implode('.', $domain);
$http_host = explode(':', $_SERVER['HTTP_HOST']);
$domain = $http_host[0];
$this->input->set_cookie(LOGIN_COOKIE, '', 0, $domain);
return $this->show_json(SYS_CODE_SUCCESS, '注销成功', '/login');
+38 -20
View File
@@ -1,54 +1,72 @@
<?php
//enter
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
class Welcome extends CI_Controller {
class Welcome extends CI_Controller
{
public function index()
{
public function index()
{
$this->load->model('sys/sys_notice_model');
$this->load->model('sys/sys_menu_model');
$list = $this->sys_menu_model->select(array('status' => 1), 'sort desc', 0, 0);
$this->load->model('sys/sys_role_model');
$role = $this->sys_role_model->get(array('id' => $this->role));
$menu_ids = explode(',', $role['menu_ids']);
foreach ($list as $item)
{
if($this->role != SUPER_ADMIN && !in_array($item['id'], $menu_ids))
{
foreach ($list as $item) {
if ($this->role != SUPER_ADMIN && !in_array($item['id'], $menu_ids)) {
continue;
}
$map[$item['id']] = $item;
}
foreach ($list as $item)
{
if($this->role != SUPER_ADMIN && !in_array($item['id'], $menu_ids))
{
foreach ($list as $item) {
if ($this->role != SUPER_ADMIN && !in_array($item['id'], $menu_ids)) {
continue;
}
if (isset($item['pid']) && isset($map[$item['pid']]))
{
if (isset($item['pid']) && isset($map[$item['pid']])) {
$map[$item['pid']]['sub'][] = &$map[$item['id']];
}
else
{
} else {
$this->data['menus'][] = &$map[$item['id']];
}
}
unset($map);
$_notice = [];
$where = [
'platform' => Sys_notice_model::PLAT_FORM_ADMIN,
'uid' => $this->uid,
'read' => Sys_notice_model::STATUS_UNREAD
];
$_noticeCount = $this->sys_notice_model->count($where);
if ($_noticeCount) {
$rows = $this->sys_notice_model->select($where, 'id desc', 1, 10);
foreach ($rows as $item) {
$_notice[] = [
'id' => $item['id'],
'icon' => Sys_notice_model::ICON_TYPE[$item['icon']] ?: Sys_notice_model::ICON_DEFAULT,
'content' => $item['content'],
'url' => $item['url'],
'read' => $item['read'],
'readCn' => $item['read'] ? '已读' : '未读',
'type' => $item['type'],
'c_time' => date('Y-m-d H:i:s')
];
}
}
$this->data['_username'] = $this->username;
$this->data['_role'] = $role['name'];
$this->data['_notice'] = $_notice;
$this->data['_noticeCount'] = $_noticeCount;
$this->load->view('index', $this->data);
return true;
}
}
public function nopage()
public function nopage()
{
$this->load->view('nopage');
+2 -1
View File
@@ -5,7 +5,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
class Member extends HD_Controller
{
private $groups = [1 => '车管家', 2 => '店长', 3 => '投资人', 4 => '客户成功经理'];
private $groups;
public function __construct()
{
@@ -13,6 +13,7 @@ class Member extends HD_Controller
$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");
$this->groups = $this->userM->get_group();
}
//首页信息
+1 -1
View File
@@ -33,7 +33,7 @@ class Brand extends HD_Controller
}
}
$count = $this->auto_brand_model->count($where);
$rows = $this->auto_brand_model->select($where, 'status desc, id desc', $page, $size);
$rows = $this->auto_brand_model->select($where, 'initial asc', $page, $size);
$status_arr = $this->auto_brand_model->get_status();
$list = [];
if ($rows) {
-1
View File
@@ -80,7 +80,6 @@ class Cars extends HD_Controller
'brand' => $map_brand[$v['brand_id']],
'series' => $map_series[$v['series_id']],
'name' => $v['name'],
'third_car_id' => $v['third_car_id'],
'status' => $v['status'],
);
}
+582
View File
@@ -0,0 +1,582 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Customer extends HD_Controller
{
private $cfrom = [1 => '空间站', 2 => '车卖场'];
private $cfrom2 = [11 => '厦门', 12 => '海口', 13 => '长沙', 14 => '佛山', 15 => '贵阳'];
//private $channel = [1 => '抖音直播', 2 => '其他'];
private $push_status = ['0' => '未上传', '-1' => '上传失败'];
private $dis_status = [0 => '未分发', 2 => '分发失败'];
private $pushAppKey = '0d14a33984239fd744fa47719de5f916';
private $keySupplyBusinessId = '67';
private $keyOutsidePvareaidId = '303556333';
private $keyExt5 = '10477';
private $channel = array(
'10477' => '宝马3',
'10489' => '腾势',
'10490' => '奇瑞',
'10491' => '方程豹',
'10492' => '五菱',
'10493' => '五菱2',
'10494' => '厦门-古惟天',
'10495' => '福州仓山',
'10496' => 'BMW',
'10497' => '宝马2',
'10498' => '梅赛德斯',
'10499' => '北京越野',
'10500' => '长沙-2',
'10501' => '长沙-3',
'10502' => '长沙-4',
'10503' => '长沙-5',
'10504' => '海口-1',
'10505' => '海口-2',
'10506' => '海口-3',
'10507' => '佛山-1',
'10508' => '佛山-2',
'10509' => '佛山-3',
'10510' => '贵阳-1',
'10511' => '贵阳-2',
'10512' => '贵阳-3',
);
public function __construct()
{
parent::__construct();
$this->load->model('autohome/autohome_customer_model');
$this->load->model("area_model");
$this->load->model("biz/biz_model");
$this->load->model("auto/auto_brand_model");
$this->load->model("auto/auto_series_model");
$this->load->helper('order');
$this->load->library('mycurl');
}
public function index()
{
$params = $this->input->get();
list($lists, $count) = $this->lists();
$this->data['province_id'] = intval($params['province_id']);
$this->data['city_id'] = intval($params['city_id']);
$this->data['provinces'] = $this->province_ary();
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['cfromAry'] = $this->cfrom;
$this->data['channelAry'] = $this->channel;
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
$this->data['_title'] = '线索列表';
return $this->show_view('autohome/lists', true);
}
public function lists($push = false)
{
$params = $this->input->get();
$where = [];
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 30;
if (strlen($params['push_id'])) {
switch ($params['push_id']){
case '0':
$where["push_id"] = 0;
break;
case '-1':
$where["push_id"] = -1;
break;
default:
$where["push_id not in ('0', '-1')"] = null;
}
}
if ($params['mobile']) {
$where["mobile like '{$params['mobile']}'"] = null;
}
//创建时间
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
if ($c_time[0]) {
$where["c_time >="] = $c_time[0] . ' 00:00:00';
}
if ($c_time[1]) {
$where["c_time <="] = $c_time[1] . ' 23:59:59';
}
}
//上传时间
if ($params['p_time']) {
$p_time = explode(' ~ ', $params['p_time']);
if ($p_time[0]) {
$where["p_time >="] = $p_time[0] . ' 00:00:00';
}
if ($p_time[1]) {
$where["p_time <="] = $p_time[1] . ' 23:59:59';
}
}
$province_id = intval($params['province_id']);
$city_id = intval($params['city_id']);
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$params['channel'] && $where['channel'] = $params['channel'];
$params['cfrom_id'] && $where['cfrom'] = $params['cfrom_id'];
$params['cfrom_id2'] && $where['cfrom2'] = $params['cfrom_id2'];
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
$params['series_id'] && $where['series_id'] = $params['series_id'];
$count = $this->autohome_customer_model->count($where);
$lists = [];
if ($count) {
$rows = $this->autohome_customer_model->select($where, 'id desc', $page, $size);
$city_id_arr = array_filter(array_unique(array_column($rows, 'city_id')));
if ($city_id_arr) {
$str_ids = implode(',', $city_id_arr);
$map_area_city = $this->area_model->map('city_id', '', ["city_id in ({$str_ids})" => null], '', 0, $size, 'city_id,province_name,city_name');
}
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
$map_biz = $this->biz_model->map('id', 'biz_name', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_name');
foreach ($rows as $val){
$area = $map_area_city[$val['city_id']][0];
$val['area_title'] = "{$area['province_name']}-{$area['city_name']}";
$val['car_title'] = $brands[$val['brand_id']][0]['name']." ".$series[$val['series_id']][0]['name'];
if($val['cfrom'] == 1){
$cf2 = $this->cfrom2[$val['cfrom2']];
}else{
$cf2 = $map_biz[$val['cfrom2']];
}
$val['cf_title'] = $this->cfrom[$val['cfrom']]." ".$cf2;
$val['channel_id'] = $val['channel'];
$val['channel'] = $this->channel[$val['channel']];
$val['push_status'] = $this->push_status[$val['push_id']] ? $this->push_status[$val['push_id']] : '上传成功';
$val['dis_status'] = $this->dis_status[$val['dis_status']];
$lists[] = $val;
}
}
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return [$lists, $count];
}
public function get()
{
$id = intval($this->input->get('id'));
$info = ['province_id' => 0];
if ($id) {
$info = $this->item_model->get(['id' => $id]);
$info['src_img'] = build_qiniu_image_url($info['img']);
}
$this->data['provinces'] = $this->province_ary();
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑' : '新增';
return $this->show_view('/receiver/items/edit', true);
}
public function add()
{
$info = $this->input->post();
$data = [
'title' => $info['title'],
's_time' => $info['s_time'],
'e_time' => $info['e_time'],
'img' => $info['img'],
'province_id' => $info['province_id'],
'descrip' => $info['descrip'],
];
$res = $this->item_model->add($data);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//编辑单条数据
public function edit()
{
$info = $this->input->post();
$row = $this->item_model->get(['id' => $info['id']]);
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
$up_data = [
'title' => $info['title'],
's_time' => $info['s_time'],
'e_time' => $info['e_time'],
'img' => $info['img'],
'province_id' => $info['province_id'],
'descrip' => $info['descrip'],
];
$res = $this->item_model->update($up_data, ['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()
{
}
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(),
'cfrom1' => $objWorksheet->getCell('C' . $_row)->getValue(),
'cfrom2' => $objWorksheet->getCell('D' . $_row)->getValue(),
'channel' => $objWorksheet->getCell('E' . $_row)->getValue(),
'province_name' => $objWorksheet->getCell('F' . $_row)->getValue(),
'city_name' => $objWorksheet->getCell('G' . $_row)->getValue(),
'brand_id' => $objWorksheet->getCell('H' . $_row)->getValue(),
'series_id' => $objWorksheet->getCell('I' . $_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 add_batch($lists=array())
{
$done = 0;
$adds = $map_province = $map_city = $map_county = $map_biz = [];
$cfrom_f = array_flip($this->cfrom);
$cfrom2_f = array_flip($this->cfrom2);
$map_biz = $this->biz_model->map('biz_name', 'id', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_name');
$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->autohome_customer_model->count(['mobile' => $v['mobile']])) {
$fails[] = array('data' => $v, 'msg' => 'mobile duplicate');
continue;
}
$cf_id = $cfrom_f[$v['cfrom1']];
if($cf_id == 1){
$cf2_id = $cfrom2_f[$v['cfrom2']];
}else{
$cf2_id = $map_biz[$v['cfrom2']];
}
$province_name = $v['province_name'];
$city_name = $v['city_name'];
if($city_name){
$city = $this->area_model->get(["city_name like '$city_name%'" => null]);
if(!$city){
$city = $this->area_model->get(["county_name like '$city_name%'" => null]);
}
$city_id = $city['city_id'];
$province_id = $city['province_id'];
}
if(!$province_id){
$province = $this->area_model->get(["province_name like '$province_name%'" => null]);
$province_id = $province['province_id'];
}
$temp = array(
'sid' => create_customer_no(),
'name' => $v['name'],
'mobile' => $v['mobile'],
'cfrom' => $cf_id ? $cf_id : 0,
'cfrom2' => $cf2_id ? $cf2_id : 0,
'channel' => $v['channel'] ? $v['channel'] : '',
'brand_id' => $v['brand_id'] ? $v['brand_id'] : '',
'series_id' => $v['series_id'] ? $v['series_id'] : '',
'province_id' => $province_id,
'city_id' => $city_id ? $city_id : 0,
'c_time' => date('Y-m-d H:i:s'),
);
switch($v['city_name']){
case '北京市':
$temp['province_id'] = 110000;
$temp['city_id'] = 110100;
break;
case '天津市':
$temp['province_id'] = 120000;
$temp['city_id'] = 120100;
break;
case '重庆市':
$temp['province_id'] =500000;
$temp['city_id'] = 500100;
break;
case '上海市':
$temp['province_id'] = 310000;
$temp['city_id'] = 310100;
break;
default:
break;
}
$adds[] = $temp;
$done++;
}
$fails && debug_log('[warning]# fails=' . json_encode($fails), __FUNCTION__, $this->log_dir);
if ($adds) {
$ret = $this->autohome_customer_model->add_batch($adds);
if (!$ret) {
debug_log("[error] add_batch fail; " . $this->autohome_customer_model->db->last_query(), __FUNCTION__, $this->log_dir);
$done = 0;
}
}
return $done;
}
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']);
}
}
public function export()
{
$params = $this->input->get();
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
if ($c_time[0]) {
$where["c_time >="] = $c_time[0] . ' 00:00:00';
}
if ($c_time[1]) {
$where["c_time <="] = $c_time[1] . ' 23:59:59';
}
}
//上传时间
if ($params['p_time']) {
$p_time = explode(' ~ ', $params['p_time']);
if ($p_time[0]) {
$where["p_time >="] = $p_time[0] . ' 00:00:00';
}
if ($p_time[1]) {
$where["p_time <="] = $p_time[1] . ' 23:59:59';
}
}
$province_id = intval($params['province_id']);
$city_id = intval($params['city_id']);
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$params['channel'] && $where['channel'] = $params['channel'];
$params['cfrom_id'] && $where['cfrom'] = $params['cfrom_id'];
$params['cfrom_id2'] && $where['cfrom2'] = $params['cfrom_id2'];
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
$params['series_id'] && $where['series_id'] = $params['series_id'];
$page = 1;
$size = 10000;
$indexs = [
'mobile' => '手机',
'cfrom' => '来源一',
'cfrom2' => '来源二',
'channel' => '渠道',
'province' => '省份',
'city' => '城市',
'brand' => '品牌',
'series' => '车型',
"p_time" => "上传时间",
];
$count = $this->autohome_customer_model->count($where);
$data = [];
if ($count) {
$rows = $this->autohome_customer_model->select($where, 'id desc', $page, $size);
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
$map_biz = $this->biz_model->map('id', 'biz_name', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_name');
$city_id_arr = array_filter(array_unique(array_column($rows, 'city_id')));
if ($city_id_arr) {
$str_ids = implode(',', $city_id_arr);
$map_area_city = $this->area_model->map('city_id', '', ["city_id in ({$str_ids})" => null], '', 0, $size, 'city_id,province_name,city_name');
}
foreach ($rows as $val){
$val['brand'] = $brands[$val['brand_id']][0]['name'];
$val['series'] = $series[$val['series_id']][0]['name'];
$area = $map_area_city[$val['city_id']][0];
$val['province'] = $area['province_name'];
$val['city'] = $area['city_name'];
if($val['cfrom'] == 1){
$cf2 = $this->cfrom2[$val['cfrom2']];
}else{
$cf2 = $map_biz[$val['cfrom2']];
}
$val['cfrom'] = $this->cfrom[$val['cfrom']];
$val['cfrom2'] = $cf2;
$val['channel'] = $this->channel[$val['channel']];
$data[] = $val;
}
}
$fileName = '客户列表';
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
function json_map_cfrom()
{
$pid = $this->input->post('pid');
$map_biz = $this->biz_model->map('biz_name', 'id', ['status' => 1, 'province_id' => 350000, 'type' => 2], '', 0, 0, 'id,biz_name');
if($pid == 1){
$this->data = $this->cfrom2;
}else{
$this->data = array_flip($map_biz);
}
return $this->show_json(SYS_CODE_SUCCESS);
}
public function push_search(){
$url = 'https://autoapi.autohome.com.cn/ggxt/xsyw/api/clues/push';
list($lists, $count) = $this->lists(1);
$succ = $fail = $undo = 0;
if($lists){
foreach ($lists as $v){
if($v['push_id']){
$undo++;
continue;
}
// if($v['brand_id']){
// $brand = $this->auto_brand_model->get(['id' => $v['brand_id']]);
// $brand_id = $brand['ah_id'];
// }
//
// if($v['series_id']){
// $series = $this->auto_series_model->get(['id' => $v['series_id']]);
// $series_id = $series['ah_id'];
// }
$push_data = array(
'pushAppKey' => $this->pushAppKey,
'keySupplyBusinessId' => $this->keySupplyBusinessId,
'keyOutsidePvareaidId' => $this->keyOutsidePvareaidId,
'keyExt5' => $v['channel_id'],
'keyExt12' => addslashes(json_encode(array('flowOrderNo' => $v['sid']))),
'splitCode' => '123',
'keyPrivateFlag' => '0',
'keyTypeId' => '2',
'keyOrderTime' => $v['c_time'],
'keyOrderCityId' => $v['city_id'] ? $v['city_id'] : '110100',
'keyName' => '客户'.$v['id'],
'keyPhone' => $v['mobile'],
'keyPurposeBrandId' => $v['brand_id'] ? $v['brand_id'] : null,
'keyPurposeFactoryId' => null,
'keyCarAudiId' => $v['series_id'] ? $v['series_id'] : null,
'keyCarTypeId' => null,
'keyCardCityId' => $v['city_id'] ? $v['city_id'] : '110100',
'keyNewCarRentSupplierId' => 1,
'keyExt1' => 376,
'keyReleaseId' => 376,
);
$res = $this->mycurl->httpPost($url, $push_data, 'is_json');
if($res){
$res = json_decode($res, true);
if(!$res['status']){
$up = array(
'push_json' => json_encode($push_data),
'push_id' => $res['result']['pushId'],
'p_time' => date('Y-m-d H:i:s'),
);
$succ++;
}else{
$push_data['res'] = $res;
$up = array(
'push_json' => json_encode($push_data),
'push_id' => -1,
'p_time' => date('Y-m-d H:i:s'),
);
$fail++;
}
$this->autohome_customer_model->update($up, array('id' => $v['id']));
}
}
$this->data['succ'] = $succ;
$this->data['fail'] = $fail;
$this->data['undo'] = $undo;
return $this->show_json(SYS_CODE_SUCCESS);
}
}
public function get_dis_status(){
$url = 'https://autoapi.autohome.com.cn/pj-clues-handler/api/queryCluesInfo';
$push_data = array(
'appKey' => $this->pushAppKey,
'keySupplyBusinessId' => $this->keySupplyBusinessId,
'pushIds' => '1728438233720721408',
);
$res = $this->mycurl->httpPost($url, $push_data, 'is_json');
if($res){
print_r(json_encode($push_data));
}
}
}
+108 -10
View File
@@ -19,6 +19,10 @@ class Store extends HD_Controller
$this->load->helper('image_helper');
$this->load->model("biz/biz_model");
$this->load->model('area_model');
$this->load->library('bizAccount');
$this->load->helper('db');
$this->load->model('auto/auto_brand_model');
$this->load->model('biz/biz_car_brand_model');
}
public function index()
@@ -64,16 +68,46 @@ class Store extends HD_Controller
$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');
}
$params['type'] && $where['type'] = $params['type'];
if ($params['brand_id']) {
$brand_biz_list = $this->biz_car_brand_model->select(['brand_id' => intval($params['brand_id'])], '', 0, 0, 'biz_id');
$bizIds = array_column($brand_biz_list, 'biz_id');
$bizIdString = $bizIds ? implode(',', $bizIds) : 0;
$where["id in ({$bizIdString})"] = null;
}
$typeAry = $this->biz_model->type_ary();
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
$count = $this->biz_model->count($where);
$bizlists = [];
foreach ($biz_lists as $v) {
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
$bizlists[] = $v;
$account = new BizAccount();
$brandAry = $this->auto_brand_model->select(['status>' => 0], 'initial asc', 0, 0, 'id,name');
if ($biz_lists) {
$map = [];
foreach ($brandAry as $item) {
$map[$item['id']] = null !== $item['name'] ? $item['name'] : '';
}
foreach ($biz_lists as $v) {
$bizAccount = $account->getAccountBizId($v['id']);
$v['money_left'] = $bizAccount ? $bizAccount['money_left'] : 0;
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
$v['biz_type'] = $typeAry[$v['type']];
// $v['brand_name'] = $map[$v['car_brand_id']];
$brand_name_list = [];
//获取门店品牌
$bizBrand = $this->biz_car_brand_model->map('brand_id', '', ['biz_id' => $v['id']], '', '', '', 'brand_id,biz_id');
if ($bizBrand) {
foreach ($bizBrand as $k1 => $v1) {
$brand_name_list[] = $map[$k1];
}
}
$v['brand_name'] = $brand_name_list ? implode(',', $brand_name_list) : '';
$bizlists[] = $v;
}
}
$this->data['brandAry'] = $brandAry;
$this->data['params'] = $params;
$this->data['lists'] = $bizlists;
$this->data['typeAry'] = $typeAry;
$this->data['_title'] = '门店列表';
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
$this->show_view('biz/store/lists', true);
@@ -82,6 +116,7 @@ class Store extends HD_Controller
public function get()
{
$id = intval($this->input->get('id'));
$this->data['typeAry'] = $this->biz_model->type_ary();
$this->data['provinces'] = $this->province_ary();
if ($id) {
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
@@ -97,7 +132,16 @@ class Store extends HD_Controller
$biz['county_id'] && $areas = $this->sys_area_model->select(array('county_id' => $biz['county_id']));
$this->data['areas'] = $areas;
$biz['avatar'] = build_qiniu_image_url($biz['headimg'], 200, 200);
$biz['car_brand_id'] = $biz['car_brand_id'] ? intval($biz['car_brand_id']) : '';
$carBrands = $this->biz_car_brand_model->select(['biz_id' => $id], '', '', 'brand_id');
$carBrandsIds = [];
if ($carBrands) {
foreach ($carBrands as $item) {
$carBrandsIds[] = intval($item['brand_id']);
}
}
$biz['car_brand_ids'] = $carBrandsIds;
$this->data['biz'] = $biz;
} else {
$map_city = $this->city_ary();
@@ -114,7 +158,7 @@ class Store extends HD_Controller
'type' => 0,
'company_id' => 0,
'auto_brands' => array(),
'car_brand_id' => 0
'car_brand_id' => ''
);//默认福建城市
$this->data['biz'] = $biz;
}
@@ -125,7 +169,7 @@ class Store extends HD_Controller
public function add()
{
$car_brand_ids = $this->input->post('car_brand_ids');
$biz['status'] = 1;
$biz['biz_name'] = $this->input->post('biz_name', true);
if (!$biz['biz_name']) {
@@ -146,6 +190,7 @@ class Store extends HD_Controller
$biz['lat'] = $this->input->post('lat', true);
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$biz['car_brand_id'] = intval($this->input->post('car_brand_id', true)) ?: '';
//上传头像
$biz['headimg'] = $this->input->post('headimg');
@@ -155,7 +200,17 @@ class Store extends HD_Controller
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
if (is_array($car_brand_ids)) {
$carBrandData = [];
foreach ($car_brand_ids as $item) {
$carBrandData[] = [
'biz_id' => $id,
'brand_id' => $item,
'c_time' => time()
];
}
$carBrandData && $this->biz_car_brand_model->replace_batch($carBrandData);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
@@ -167,7 +222,7 @@ class Store extends HD_Controller
$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));
$car_brand_ids = $this->input->post('car_brand_ids');
$biz['biz_name'] = $this->input->post('biz_name', true);
if (!$biz['biz_name']) {
return $this->show_json(SYS_CODE_FAIL, '门店不能为空');
@@ -187,13 +242,28 @@ class Store extends HD_Controller
$biz['lat'] = $this->input->post('lat', true);
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$biz['car_brand_id'] = intval($this->input->post('car_brand_id', true)) ?: '';
//上传头像
$biz['headimg'] = $this->input->post('headimg');
$res = $this->biz_model->update($biz, array('id' => $id));
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
if (is_array($car_brand_ids)) {
$brandIds = implode(',', $car_brand_ids);
$brandIds && $this->biz_car_brand_model->delete(['biz_id' => $id, 'brand_id NOT IN(' . $brandIds . ')' => null]);
$carBrandData = [];
foreach ($car_brand_ids as $item) {
$carBrandData[] = [
'biz_id' => $id,
'brand_id' => $item,
'c_time' => time()
];
}
$carBrandData && $this->biz_car_brand_model->replace_batch($carBrandData);
} else {
$this->biz_car_brand_model->delete(['biz_id' => $id]);
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
@@ -265,7 +335,10 @@ class Store extends HD_Controller
$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);
if ($province_id || $city_id || $county_id || $title) {
$total = $this->biz_model->count($where);
}
$lists = array();
if ($total) {
@@ -284,4 +357,29 @@ class Store extends HD_Controller
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
public function add_money()
{
$id = intval($this->input->get_post('id'));
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
if (!$biz) {
return $this->show_json(0, '门店不存在');
}
if ($this->input->method() == 'post') {
$money = $this->input->post('money');
if (!$money) {
return $this->show_json(SYS_CODE_FAIL, '请输入金额');
}
$bizAccount = new BizAccount();
$account = $bizAccount->getAccountBizId($id, true);
$sqlArr = $bizAccount->charge($account['id'], $money, '充值');
$result = trans_sql($sqlArr);
if (!$result) {
return $this->show_json(SYS_CODE_FAIL, '充值失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '充值成功');
}
$this->data['biz'] = $biz;
$this->show_view('biz/store/add_money');
}
}
+433 -47
View File
@@ -8,6 +8,8 @@ class Clues extends HD_Controller
protected $log_dir;
private $maintainAry = ['0-0' => '待处理', '1-10' => '已加微信', '3-7' => '明确拒绝', '2-4' => '未接通', '2-5' => '未完整触碰'];//保养客户专用
private $role_id = 2;
public function __construct()
{
parent::__construct();
@@ -15,13 +17,22 @@ class Clues extends HD_Controller
$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_yx_model', 'mdReceiverXz');
// $this->load->model('receiver/receiver_yx_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->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('app/paic/app_paic_users_model');
$this->load->model('receiver/receiver_enroll_model');
$this->load->model('biz/biz_car_brand_model');
$this->load->model('sys/sys_notice_model');
$this->load->model('sys/Sys_admin_model', 'sysAdmin');
$this->log_dir = 'receiver_clues';
}
@@ -36,6 +47,11 @@ class Clues extends HD_Controller
foreach ($this->clues_model->statusAry() as $key => $value) {
$cate = array();
$where = array("status" => $key);
if ($this->admin_biz_str) {
$where["belong_id in ($this->admin_biz_str)"] = null;
} else {
$this->belong && $where["belong_id"] = $this->belong;
}
$count1 = $this->clues_model->count($where);
if ($value['list']) {
foreach ($value['list'] as $key2 => $value2) {
@@ -47,9 +63,7 @@ class Clues extends HD_Controller
$statusList[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
if (!strlen($params['wxgr'])) {
$params['wxgr'] = 1;
}
$export_button = (SUPER_ADMIN == $this->role || $this->uid == 4) ? 1 : 0;
$this->data['province_id'] = intval($params['province_id']);
$this->data['city_id'] = intval($params['city_id']);
@@ -62,7 +76,9 @@ class Clues extends HD_Controller
$this->data['cfromAry2'] = $map_cfrom2;
$this->data['statusList'] = $statusList;
$this->data['maintainAry'] = $this->maintainAry;
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
$this->data['export_button'] = $export_button;
$this->data['role'] = $this->role;
$this->data['levelList'] = Receiver_clues_model::LEVEL_LIST;
$this->data['_title'] = '线索池列表';
return $this->show_view('receiver/clues/lists', true);
}
@@ -84,6 +100,11 @@ class Clues extends HD_Controller
if ($params['title']) {
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
if ($this->admin_biz_str) {
$where["belong_id in ($this->admin_biz_str)"] = null;
} else {
$params['belong_id'] && $where["belong_id"] = $params['belong_id'];
}
//创建时间
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
@@ -95,13 +116,13 @@ class Clues extends HD_Controller
}
}
//最后报名时间
if ($params['en_time']) {
$en_time = explode(' ~ ', $params['en_time']);
if ($params['p_time']) {
$en_time = explode(' ~ ', $params['p_time']);
if ($en_time[0]) {
$where["en_time >="] = $en_time[0] . ' 00:00:00';
$where["p_time >="] = $en_time[0] . ' 00:00:00';
}
if ($en_time[1]) {
$where["en_time <="] = $en_time[1] . ' 23:59:59';
$where["p_time <="] = $en_time[1] . ' 23:59:59';
}
}
@@ -111,7 +132,7 @@ class Clues extends HD_Controller
$where["status > "] = '-1';
}
if (strlen($params['wxgr']) && $params['wxgr'] != 2) {
if (strlen($params['wxgr'])) {
$where["wxgr"] = $params['wxgr'];
}
@@ -121,6 +142,10 @@ class Clues extends HD_Controller
$county_id && $where['county_id'] = $county_id;
$params['cfrom_id'] && $where['cf_id'] = $params['cfrom_id'];
$params['cfrom_id2'] && $where['cf2_id'] = $params['cfrom_id2'];
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
$params['series_id'] && $where['series_id'] = $params['series_id'];
strlen($params['admin_id']) && $where['admin_id'] = $params['admin_id'];
$params['level'] && $where['level'] = $params['level'];
//门店筛选
if ($params['biz_id_admin']) {
@@ -137,11 +162,16 @@ class Clues extends HD_Controller
!$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['brand_id'] && $params['brand_id'] = 0;
!$params['series_id'] && $params['series_id'] = 0;
!strlen($params['admin_id']) && $params['admin_id'] = '';
$params['level'] && $params['level'] = '';
$count = $this->clues_model->count($where);
$lists = [];
if ($count) {
$fileds = 'id,name,mobile,cf_id,cf2_id,c_time,admin_id,status,status2,en_time,province_id,city_id,county_id,biz_id';
$fileds = 'id,name,mobile,brand_id,series_id,cf_id,cf2_id,c_time,admin_id,status,status2,en_time,
province_id,city_id,county_id,biz_id,p_time,u_time,rec_time,app_id';
$rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds);
$map_admin = $map_cf_pid = $cf_title_arr = [];
@@ -178,7 +208,7 @@ class Clues extends HD_Controller
$biz_id_arr && $biz_rows = $this->biz_model->map('id', 'id,biz_name,county_id', ["id in ({$str_ids})" => null], '', '', '', 'id,biz_name,county_id');
//门店位置
$county_id_bizarr = array_filter(array_unique(array_column($biz_rows, 'county_id')));
$biz_rows && $county_id_bizarr = array_filter(array_unique(array_column($biz_rows, 'county_id')));
if ($county_id_bizarr) {
$str_ids = implode(',', $county_id_bizarr);
$map_area_biz = $this->area_model->map('county_id', '', ["county_id in ({$str_ids})" => null], '', 0, $size, 'county_id,province_name,city_name,county_name');
@@ -202,6 +232,10 @@ class Clues extends HD_Controller
$str_ids = implode(',', $province_id_arr);
$map_area_province = $this->area_model->map('province_id', '', ["province_id in ({$str_ids})" => null], '', 0, $size, 'province_id,province_name');
}
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
foreach ($rows as $key => $val) {
$val['cf_title'] = $cf_title_arr[$val['cf2_id']] ? $cf_title_arr[$val['cf2_id']] : $cf_title_arr[$val['cf_id']];
@@ -227,11 +261,27 @@ class Clues extends HD_Controller
$bizarea = $map_area_biz[$biz_rows[$val['biz_id']]['county_id']][0];
$val['biz_poi'] = "{$bizarea['province_name']}-{$bizarea['city_name']}-{$bizarea['county_name']}";
if ($brands[$val['brand_id']]) {
$val['brand_detail'] = $brands[$val['brand_id']][0]['name'];
$val['series_detail'] = $series[$val['series_id']][0]['name'];
}
if ($val['p_time'] == '0000-00-00 00:00:00') {
$val['p_time'] = '';
}
$val['rec_time'] = $val['rec_time'] != '0000-00-00 00:00:00' ? $val['rec_time'] : '';
$is_unlock = '';
if ($val['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY && $val['status'] == 1) {
$unlockCustomer = $this->customers_model->get(['rid' => $val['id'], 'un_lock' => Receiver_customers_model::LOCK_STATUS]);
$is_unlock = $unlockCustomer ? '已解锁' : '未解锁';
}
$val['is_unlock'] = $is_unlock;
$lists[] = $val;
}
}
$where = ['status' => 1, 'role_id' => $this->role_id];
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username');
$this->data['adminLists'] = $adminLists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
return [$lists, $count];
}
@@ -263,6 +313,7 @@ class Clues extends HD_Controller
$info_show['c_time'] = date('Y-m-d H:i', $re['c_time']);
$info_show['en_time'] = $re['en_time'];
$info_show['mobile_sub'] = $re['mobile'];
$info_show['buy_time_cn'] = $re['buy_time'] ? Receiver_clues_model::BUY_TIME_LIST[$re['buy_time']] : '';
$resLogs = $this->mdOplogs->select(array('clue_id' => $id), 'c_time desc', 0, 0);
foreach ($resLogs as $key => $value) {
@@ -271,21 +322,22 @@ class Clues extends HD_Controller
$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 = '录音文件未生成';
}
}
list($rec_url, $rec_text) = $this->mdOplogs->getRecordUrl($value['id']);
// 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;
$dataInfo['rec_time'] = $dataInfo['rec_time'] == '0000-00-00 00:00:00' ? '' : $dataInfo['rec_time'];
//获取所在地区
$dataInfo['province_id'] = $re['province_id'];
$dataInfo['city_id'] = $re['city_id'];
@@ -298,15 +350,25 @@ class Clues extends HD_Controller
$dataInfo['county_id_admin'] = $biz ? $biz['county_id'] : 0;
$customer = $this->customers_model->get(array('rid' => $re['id'], 'biz_id' => $re['biz_id'], 'status >' => -1));
$dataInfo['customer_id'] = $customer['id'];
$dataInfo['cf_pid'] = $dataInfo['cf_pid'] ?: '';
$dataInfo['brand_id'] = $dataInfo['brand_id'] ?: '';
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', array('status' => 1, 'pid' => 0, 'type' => 0), '', 0, 0, 'id, title');
$map_cfrom2 = $this->clues_cfrom_model->map('id', 'title', array('status' => 1, 'pid' => $params['cfrom_id']), '', 0, 0, 'id, title');
//已分配门店
$selectedBrands1 = [];
if ($dataInfo['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
$customerRows = $this->customers_model->select(['rid' => $re['id'], 'status >' => -1], '', '', '', 'biz_id');
$ids = implode(',', array_column($customerRows, 'biz_id'));
$ids && $selectedBrands1 = $this->biz_model->select(["id in ($ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
}
$this->data['cfromAry'] = $map_cfrom;
$this->data['cfromAry2'] = $map_cfrom2;
$this->data['provinces'] = $this->province_ary();
$this->data['info'] = $dataInfo;
$this->data['info_show'] = $info_show;
$this->data['selectedBrands1'] = $selectedBrands1;
$this->data['buyTimeList'] = Receiver_clues_model::BUY_TIME_LIST;
$this->data['_title'] = '线索详情';
return $this->show_view('receiver/clues/edit', true);
}
@@ -365,10 +427,12 @@ class Clues extends HD_Controller
'mobile' => '',
'cf_id' => '',
'cf2_id' => '',
'province_id' => 0,
'province_id' => $this->limit_province_id,
'city_id' => 0,
'county_id' => 0,
'biz_id' => 0,
'brand_id' => 0,
'series_id' => 0,
);
$title = "新增线索";
$action = "add";
@@ -381,20 +445,21 @@ class Clues extends HD_Controller
$this->data['info'] = $info;
$this->data['cfromAry'] = $map_cfrom;
$this->data['action'] = $action;
$this->data['limit_province_id'] = $this->limit_province_id;
$this->data['_title'] = $title;
return $this->show_view('receiver/clues/get');
return $this->show_view('receiver/clues/get', true);
}
//添加单条数据
public function add()
{
$info = $this->input->post('info');
if (!$info['name']) {
return $this->show_json(SYS_CODE_FAIL, '请填写姓名');
if (!$info['name'] && !$info['sex']) {
return $this->show_json(SYS_CODE_FAIL, '请填写姓名或称谓');
}
if (!mobile_valid($info['mobile'])) {
if (!mobile_valid($info['mobile']) && strlen($info['mobile']) != 14) {
return $this->show_json(SYS_CODE_FAIL, '手机号码不准确');
}
@@ -410,11 +475,14 @@ class Clues extends HD_Controller
}
$add = array(
'name' => $info['name'],
'name' => $info['name'] . $info['sex'],
'mobile' => $info['mobile'],
'cf_id' => $info['cf_id'],
'cf2_id' => $info['cf2_id'],
'brand_id' => $info['brand_id'],
'series_id' => $info['series_id'],
'admin_id' => $this->uid,
'belong_id' => $this->belong,
'c_time' => time(),
'en_time' => date('Y-m-d H:i:s'),
);
@@ -425,10 +493,92 @@ class Clues extends HD_Controller
$info['biz_id'] && $add['status'] = 1;
$info['biz_id'] && $add['status2'] = 1;
$info['biz_id'] && $add['p_time'] = date('Y-m-d H:i:s');
$info['cf_pid'] && $add['cf_pid'] = $info['cf_pid'];
$ret = $this->clues_model->add($add);
if ($ret) {
$log = '新增线索';
$this->addLog(array('clue_id' => $ret, 'type' => 3, 'log' => $log));
if ($info['text']) {
$log = $info['text'];
sleep(1);
$this->addLog(array('clue_id' => $ret, 'type' => 0, 'log' => $log));
}
if ($info['push'] && $info['biz_id']) {
if ($this->customers_model->get(array('mobile' => $info['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))) {
$code = SYS_CODE_FAIL;
$msg = '门店已在跟踪';
} else {
$this->load->helper("order");
$biz = $this->biz_model->get(array('id' => $info['biz_id']));
$add = array(
'rid' => $ret,
'cid' => create_customer_no($biz['county_id']),
'name' => $info['name'] . $info['sex'],
'mobile' => $info['mobile'],
'biz_id' => $info['biz_id'],
'level' => 'H',
'cf_title' => '数字营销中台',
'of_id' => $info['cf_id'],
'of2_id' => $info['cf2_id'],
'brand_id' => $info['brand_id'],
'series_id' => $info['series_id'],
'p_time' => date('Y-m-d H:i:s'),
'c_time' => time(),
);
$info['province_id'] && $add['province_id'] = $info['province_id'];
$info['city_id'] && $add['city_id'] = $info['city_id'];
$info['county_id'] && $add['county_id'] = $info['county_id'];
$info['cf_pid'] && $add['cf_pid'] = $info['cf_pid'];
$customers_id = $this->customers_model->add($add);
if ($customers_id) {
sleep(1);
$this->addLog(array('clue_id' => $ret, 'type' => 3, 'log' => '转交门店跟进'));
$this->clues_model->update(['status' => 1, 'status2' => 2], ['id' => $ret]);
//同步线索日志到客户日志
$this->load->library('receiver/customers_entity');
$this->customers_entity->syn_clues($customers_id, $ret);
//短信通知店长
$this->load->model('app/licheb/app_licheb_users_model');
$where = array('biz_id' => $info['biz_id'], 'status' => 1, 'group_id' => 2);
$res_u = $this->app_licheb_users_model->select($where);
if ($res_u) {
foreach ($res_u as $v) {
if ($info['biz_id'] != 1) {
// b2m_send_sms($v['mobile'], '【好店云(厦门)科技】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
ems_sms($v['mobile'], '您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
}
}
}
$code = SYS_CODE_SUCCESS;
$msg = '转交成功';
} else {
$code = SYS_CODE_FAIL;
$msg = '转交失败';
}
}
return $this->show_json($code, $msg);
}
//推送消息给中台客服
// $noticeAdmins = $this->sysAdmin->select(['role_id' => 2, 'status' => 1], '', 0, 0, 'id');
// if ($noticeAdmins) {
// foreach ($noticeAdmins as $noticeAdmin) {
// $params = [
// 'platform' => Sys_notice_model::PLAT_FORM_ADMIN,
// 'uid' => $noticeAdmin['id'],
// 'content' => "超级车补新增了一条线索,请及时处理.",
// 'url' => '/receiver/clues/get?id=' . $ret,
// ];
// $endPlatform = Sys_notice_model::PLAT_FORM_SYS_ADMIN;
// $this->sys_notice_model->addNotice($params, $endPlatform, $this->uid);
// }
// }
return $this->show_json(SYS_CODE_SUCCESS, '新增成功');
} else {
debug_log("[error]# add fail; " . $this->clues_model->db->last_query(), __FUNCTION__, $this->log_dir);
@@ -445,16 +595,43 @@ class Clues extends HD_Controller
if (!$params['log']) {
return $this->show_json(SYS_CODE_FAIL, '请输入内容!');
}
// if (strlen($params['buy_time'])) {
// $buy_time_cn = Receiver_clues_model::BUY_TIME_LIST[$params['buy_time']];
// $addData = array(
// 'clue_id' => $params['id'],
// 'uid' => $this->uid,
// 'uname' => $this->username,
// 'type' => intval($params['type']),
// 'log' => '修改意向购车周期为:' . $buy_time_cn,
// 'c_time' => time()
// );
// $this->mdOplogs->add($addData);
// $this->clues_model->update(['buy_time' => $params['buy_time']], ['id' => $params['id']]);
// }
$addData = array(
'clue_id' => $params['id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($params['type']),
'log' => $params['log'],
'c_time' => time()
'c_time' => time(),
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_ADMIN
);
$id = $this->mdOplogs->add($addData);
if ($id) {
if ($params['notice']) { //推送消息
$clues = $this->clues_model->get(['id' => $params['id']]);
if ($clues['pingan_user_id'] && $clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
$params = [
'platform' => Sys_notice_model::PLAT_FORM_PINGAN,
'uid' => $clues['pingan_user_id'],
'content' => $params['log'],
'url' => '/receiver/clues/detail?id=' . $clues['id'],
];
$endPlatform = Sys_notice_model::PLAT_FORM_SYS_ADMIN;
$this->sys_notice_model->addNotice($params, $endPlatform, $this->uid);
}
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
@@ -541,14 +718,22 @@ class Clues extends HD_Controller
$log = '';
$up = [];
if(!$info['cf2_id']){
if (!$info['cf2_id']) {
$code = SYS_CODE_FAIL;
$msg = '修改用户信息失败';
}else{
} else {
if ($info['name'] != $re['name']) {
$log .= '更新客户姓名 ';
$up['name'] = $info['name'];
}
if ($info['mobile'] != $re['mobile']) {
$log .= '更新客户手机号 ';
$up['mobile'] = $info['mobile'];
if ($this->clues_model->get(['mobile' => $info['mobile']])) {
return $this->show_json(SYS_CODE_FAIL, '线索已存在');
}
}
if ($info['wxgr'] != $re['wxgr']) {
$up['wxgr'] = $info['wxgr'];
}
@@ -557,6 +742,13 @@ class Clues extends HD_Controller
$up['province_id'] = $info['province_id'];
$up['city_id'] = $info['city_id'];
$up['county_id'] = $info['county_id'];
// if ($info['province_id'] == '460000') {
// $up['belong_id'] = 39;
// }
if(Receiver_clues_model::PROVINCE_BELONG[$info['province_id']]){
$up['belong_id'] = Receiver_clues_model::PROVINCE_BELONG[$info['province_id']];
}
}
if ($info['cf_id'] != $re['cf_id'] || $info['cf2_id'] != $re['cf2_id']) {
$log .= '更新客户来源 ';
@@ -564,6 +756,19 @@ class Clues extends HD_Controller
$up['cf2_id'] = $info['cf2_id'];
}
if ($info['brand_id'] != $re['brand_id'] || $info['series_id'] != $re['series_id']) {
$log .= '更新客户关注车型 ';
$up['brand_id'] = $info['brand_id'];
$up['series_id'] = $info['series_id'];
}
if ($info['cf_pid'] != $re['cf_pid']) {
$up['cf_pid'] = $info['cf_pid'];
}
if ($info['buy_time'] != $re['buy_time']) {
$log .= '修改意向购车周期为: ' . Receiver_clues_model::BUY_TIME_LIST[$info['buy_time']];
$up['buy_time'] = $info['buy_time'];
$up['level'] = Receiver_clues_model::LEVEL_LIST[$info['buy_time']] ?: Receiver_clues_model::LEVEL_DEFAULT;
}
$ret = $this->clues_model->update($up, array('id' => $info['id']));
if (!$ret) {
@@ -580,24 +785,24 @@ class Clues extends HD_Controller
$code = SYS_CODE_FAIL;
$msg = '门店已有该线索';
} else {
if($clue = $this->clues_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))){
if ($clue = $this->clues_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))) {
$code = SYS_CODE_FAIL;
$msg = '门店已派单';
}else{
} else {
$up_data = [
'biz_id' => $info['biz_id'],
'status' => 1,
'status2' => 1,
'p_time' => date('Y-m-d H:i:s'),
];
$info['rec_time'] && $up_data['rec_time'] = $info['rec_time'];
$ret = $this->clues_model->update($up_data, array('id' => $info['id']));
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '派单门店失败';
} else {
$msg = $info['editType'] == 3 ? '派单门店成功' : '改派门店成功';
$log = $info['editType'] == 3 ? '派单门店' : '改派门店';
$msg = $info['editType'] == 3 ? '派单门店成功' : '改派门店成功';
$log = $info['editType'] == 3 ? '派单门店' : '改派门店';
$this->addLog(array('clue_id' => $info['id'], 'type' => 3, 'log' => $log));
}
}
@@ -622,15 +827,18 @@ class Clues extends HD_Controller
'cf_title' => '数字营销中台',
'of_id' => $re['cf_id'],
'of2_id' => $re['cf2_id'],
'brand_id' => $re['brand_id'],
'series_id' => $re['series_id'],
'p_time' => $re['p_time'],
'cont_time' => $re['cont_time'],
'cf_pid' => $re['cf_pid'],
'c_time' => $re['c_time'],
);
$customers_id = $this->customers_model->add($add);
if ($customers_id) {
$this->addLog(array('clue_id' => $re['id'], 'type' => 3, 'log' => '转交门店跟进'));
$this->clues_model->update(['status' => 1, 'status2' => 1], ['id' => $re['id']]);
$this->clues_model->update(['status' => 1, 'status2' => 2], ['id' => $re['id']]);
//同步线索日志到客户日志
$this->load->library('receiver/customers_entity');
@@ -639,9 +847,14 @@ class Clues extends HD_Controller
//短信通知店长
$this->load->model('app/licheb/app_licheb_users_model');
$where = array('biz_id' => $re['biz_id'], 'status' => 1, 'group_id' => 2);
$res_u = $this->app_licheb_users_model->get($where);
if($re['biz_id'] != 1){
b2m_send_sms($res_u['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
$res_u = $this->app_licheb_users_model->select($where);
if ($res_u) {
foreach ($res_u as $v) {
if ($re['biz_id'] != 1) {
// b2m_send_sms($v['mobile'], '【好店云(厦门)科技】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
ems_sms($v['mobile'], '您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
}
}
}
$msg = '转交成功';
@@ -672,7 +885,8 @@ class Clues extends HD_Controller
'uname' => $this->username,
'type' => intval($ary['type']),
'log' => $ary['log'],
'c_time' => time()
'c_time' => time(),
'cf_platform' => Receiver_clue_oplogs_model::CF_PLATFORM_ADMIN
);
$id = $this->mdOplogs->add($addData);
}
@@ -708,12 +922,17 @@ class Clues extends HD_Controller
'id' => 'ID',
'name' => '客户姓名',
'mobile' => '手机',
'poi' => '所在地区',
'cf_title' => "来源",
'wxgr' => '是否添加微信',
'biz_name' => '派单门店',
'biz_poi' => '门店所在地区',
'brand_detail' => '关注品牌',
'series_detail' => '关注车型',
'status_name' => '状态',
'p_time' => '分配时间',
'c_time' => '创建时间',
'u_time' => '更新时间'
];
$data = [];
if ($lists) {
@@ -722,12 +941,17 @@ class Clues extends HD_Controller
'id' => $val['id'],
'name' => $val['name'],
'mobile' => $val['mobile'],
'poi' => $val['poi'],
'cf_title' => $val['cf_title'],
'wxgr' => $val['wxgr'] ? '是' : '否',
'biz_name' => $val['biz_name'],
'biz_poi' => $val['biz_poi'],
'brand_detail' => $val['brand_detail'],
'series_detail' => $val['series_detail'],
'status_name' => $val['status_name'],
'p_time' => $val['p_time'],
'c_time' => date('Y-m-d H:i:s', $val['c_time']),
'u_time' => $val['u_time']
];
$data[] = $item;
}
@@ -750,9 +974,6 @@ class Clues extends HD_Controller
];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',', array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
$this->data['bizList'] = $bizList;
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
@@ -802,7 +1023,8 @@ class Clues extends HD_Controller
'of2_id' => 37,
'cf_id' => $clues_row['cf_id'],
'p_time' => date('Y-m-d H:i:s'),
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time'])
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time']),
'cf_pid' => $clues_row['cf_pid'],
];
$customers_id = $this->customers_model->add($add_data);
if ($customers_id) {
@@ -946,7 +1168,7 @@ class Clues extends HD_Controller
$total = $this->clues_cfrom_model->count($where);
$map = array();
if ($total) {
$orderby = 'id desc';
$orderby = 'sort desc';
$select = 'id, title';
$rows = $this->clues_cfrom_model->select($where, $orderby, 0, 0, $select);
foreach ($rows as $v) {
@@ -1026,6 +1248,7 @@ class Clues extends HD_Controller
'city_id' => $map_city[$v['city_name']] ? $map_city[$v['city_name']] : 0,
'county_id' => $map_county[$v['county_name']] ? $map_county[$v['county_name']] : 0,
'biz_id' => $map_biz[$v['biz_name']] ? $map_biz[$v['biz_name']] : 0,
'belong_id' => $this->belong,
'p_time' => $map_biz[$v['biz_name']] ? date('Y-m-d H:i:s') : 0,
);
$adds[] = $temp;
@@ -1068,4 +1291,167 @@ class Clues extends HD_Controller
$this->data['bizinfo'] = $bizinfo;
return $this->show_json(SYS_CODE_SUCCESS);
}
//分配管理员
public function edit_admins()
{
$ids = $this->input->get_post('ids');
if ($this->input->method() == 'post') {
$ids_array = explode(',', $ids);
$admin_id = $this->input->post('admin_id');
if (is_array($ids_array)) {
foreach ($ids_array as $item) {
$this->clues_model->update(['admin_id' => $admin_id, 'p_time' => date('Y-m-d H:i:s')], ['id' => $item]);
}
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
$where = ['status' => 1, 'role_id' => $this->role_id];
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username');
$this->data['adminLists'] = $adminLists;
$this->data['ids'] = $ids;
return $this->show_view('receiver/clues/get_admin');
}
//派单到客户池
public function add_customer()
{
$this->load->helper("order");
$info = $this->input->post('info');
$bizList = $this->input->post('bizList');
if (!count($bizList)) {
return $this->show_json(SYS_CODE_FAIL, '请选择门店');
}
// if (!$info['rec_time']) {
// 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, '线索不存在!');
}
foreach ($bizList as $item) {
$customers = $this->customers_model->get(array('rid' => $re['id'], 'status >' => -1, 'biz_id' => $item['biz_id']));
if ($customers) {
continue;
}
$biz = $this->biz_model->get(array('id' => $item['biz_id']));
//获取一条门店品牌
$bizBrand = $this->biz_car_brand_model->get(['biz_id' => $biz['id']]);
$add = array(
'rid' => $re['id'],
'cid' => create_customer_no($biz['county_id']),
'name' => $re['name'],
'province_id' => $biz['province_id'],
'city_id' => $biz['city_id'],
'county_id' => $biz['county_id'],
'mobile' => $re['mobile'],
'biz_id' => $item['biz_id'],
'level' => $re['level'],
'cf_title' => '数字营销中台',
'of_id' => $re['cf_id'],
'of2_id' => $re['cf2_id'],
'brand_id' => $re['brand_id'],
'series_id' => $re['series_id'],
'p_time' => date('Y-m-d H:i:s'),
'cont_time' => $re['cont_time'],
'cf_pid' => $re['cf_pid'],
'c_time' => $re['c_time'],
'rec_time' => $info['rec_time'] ?: date('Y-m-d H:i:s')
);
if ($re['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
$add['un_lock'] = Receiver_customers_model::UNLOCK_STATUS;
}
//获取用户留资记录与门店品牌对应数据
if ($bizBrand) {
$where = ['mobile' => $re['mobile'], 'brand_id' => $bizBrand['brand_id']];
$enrollRows = $this->receiver_enroll_model->select($where, 'id desc', 1, 1);
if ($enrollRows) {
$add['brand_id'] = $enrollRows[0]['brand_id'];
$add['series_id'] = $enrollRows[0]['series_id'];
}
}
$customers_id = $this->customers_model->add($add);
if (!$customers_id) {
continue;
}
// if ($biz['type'] == Biz_model::BIZ_TYPE_SPACE) {
// //解锁
// /** @var MyResponse $result */
// $result = $this->customers_model->unlock($customers_id, $biz['id'], false);
// }
//同步线索日志到客户日志
$this->load->library('receiver/customers_entity');
$this->customers_entity->syn_clues($customers_id, $re['id']);
//短信通知店长
$this->load->model('app/licheb/app_licheb_users_model');
$where = array('biz_id' => $biz['id'], 'status' => 1, 'group_id' => 2);
$res_u = $this->app_licheb_users_model->select($where);
if ($res_u) {
foreach ($res_u as $v) {
if ($re['biz_id'] != 1) {
// b2m_send_sms($v['mobile'], '【理车宝】您好,门店新增了1个客户线索。请及时到小程序"理车宝-待分配客户”分配给销售顾问跟进。祝您生活愉快!');
ems_sms($v['mobile'], '您好,门店新增了1个客户线索,请及时到微信小程序"理车宝”进行查看。');
debug_log("[info]:发短信到{$v['mobile']},线索派单", 'send_sms.txt', $this->log_dir);
}
}
}
}
$this->clues_model->update(['rec_time' => $info['rec_time'], 'p_time' => date('Y-m-d H:i:s')], ['id' => $re['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '修改成功');
}
/**
* 删除客户派单
* @return bool
*/
public function edit_customer()
{
$info = $this->input->post('info');
$bizId = $this->input->post('bizId');
if (!$bizId) {
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, '线索不存在!');
}
$this->customers_model->update(array('status' => -1), ['rid' => $re['id'], 'biz_id' => $bizId]);
return $this->show_json(SYS_CODE_SUCCESS, '修改成功');
}
public function lists_enroll()
{
$params = $this->input->get();
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$list = [];
$id = intval($params['id']);
$clues = $this->clues_model->get(['id' => $id]);
if (!$clues) {
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
}
$where = ['mobile' => $clues['mobile']];
$count = $this->receiver_enroll_model->count($where);
if ($count) {
$rows = $this->receiver_enroll_model->select($where, 'id desc', $page, $size);
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
foreach ($rows as $key => $value) {
$setValue = $value;
$setValue['mobile'] = $value['mobile'];
$setValue['c_time'] = date('Y-m-d H:i:s');
$brandName = $brands[$value['brand_id']] ? $brands[$value['brand_id']][0]['name'] : '';
$seriesName = $series[$value['series_id']] ? $series[$value['series_id']][0]['name'] : '';
$cfRow = $this->clues_cfrom_model->get(['id' => $value['cf2_id']]);
$cfrom2 = $cfRow['title'] ?: '';
$setValue['brandName'] = "{$brandName} {$seriesName}";
$setValue['cfrom2'] = $cfrom2;
$list[] = $setValue;
}
}
$this->data['list'] = $list;
$this->data['count'] = $count;
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+2 -2
View File
@@ -102,7 +102,7 @@ class CluesCfrom extends HD_Controller
}
$re = $this->mdCluesCfrom->get(array('type' => 1, 'pid' => 0, "status" => 1));
if ($re && $re['id'] != $params['id']) {
if ($re && $params['type'] == 1) {
return $this->show_json(SYS_CODE_FAIL, '门店分类最多存在一个!');
}
@@ -129,7 +129,7 @@ class CluesCfrom extends HD_Controller
}
$re = $this->mdCluesCfrom->get(array('type' => 1, 'pid' => 0, "status" => 1));
if ($re && $re['id'] != $params['id']) {
if ($re && $re['id'] != $params['id'] && $params['type'] == 1) {
return $this->show_json(SYS_CODE_FAIL, '门店分类最多存在一个!');
}
$this->mdCluesCfrom->update(['title' => $params['name'], 'type' => $params['type'],'sort' => $params['sort']], ['id' => $params['id']]);
+103 -30
View File
@@ -10,7 +10,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
class Customer extends HD_Controller
{
private $searchTpAry = array('mobile' => '客户手机号', 'cid' => '客户编号');
private $searchTimeAry = array('p_time' => '派单/建档时间', 'cont_time' => '最后联系时间', 'dt_time' => '首次到店时间', 'order_time' => '下定时间', 'def_time' => '战败时间','c_time' => '创建时间', );
private $searchTimeAry = array('unlock_time' => '解锁时间', 'p_time' => '派单/建档时间', 'cont_time' => '最后联系时间', 'dt_time' => '首次到店时间', 'order_time' => '下定时间', 'def_time' => '战败时间', 'c_time' => '创建时间');
protected $log_dir;
@@ -24,10 +24,13 @@ class Customer extends HD_Controller
$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_yx_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('area_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('app/paic/app_paic_users_model');
$this->log_dir = 'receiver_' . get_class($this);
}
@@ -45,6 +48,7 @@ class Customer extends HD_Controller
$params = $this->input->get();
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$where = $this->get_where($params);
$count = $this->customers_model->count($where);
$lists = [];
@@ -52,7 +56,7 @@ class Customer extends HD_Controller
//$wxqyAry = $this->customers_model->wxqyAry();
$wxgrAry = $this->customers_model->wxgrAry();
if ($count) {
$fileds = 'id,cid,name,mobile,cf_title,p_time,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxgr,c_time,county_id';
$fileds = 'id,rid,cid,name,mobile,cf_title,p_time,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxgr,c_time,county_id,brand_id,series_id,un_lock';
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
//获取车管家
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
@@ -60,6 +64,9 @@ class Customer extends HD_Controller
//获取门店
$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,county_id');
//车型
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
foreach ($biz_rows as $v) {
$county_id_arr[] = $v[0]['county_id'];
@@ -93,25 +100,38 @@ class Customer extends HD_Controller
$mobile_sub = $val['mobile'];
$of_title = $cf_title_arr[$val['of2_id']] ? $cf_title_arr[$val['of2_id']] : $cf_title_arr[$val['of_id']];
$area = $map_area[$biz_rows[$val['biz_id']][0]['county_id']][0];
$brand_detail = '';
if ($brands[$val['brand_id']]) {
$brand_detail = $brands[$val['brand_id']][0]['name'];
}
if ($brands[$val['brand_id']]) {
$brand_detail .= '-' . $series[$val['series_id']][0]['name'];
}
$clues = $this->clues_model->get(['id' => $val['rid']]);
$is_unlock = '';
if ($clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
$is_unlock = Receiver_customers_model::LOCK_LIST[$val['un_lock']];
}
$lists[] = array(
'id' => $val['id'],
'cid' => $val['cid'],
'name' => $val['name'],
'mobile' => $val['mobile'],
'mobile_sub' => $mobile_sub,
'mobile_sub' => $this->get_mobile(['of_id' => $val['of_id'], 'mobile' => $mobile_sub]),
'level' => $val['level'],
'of_title' => $of_title,
'of_id' => $val['of_id'],
'of2_id' => $val['of2_id'],
'status_name' => $status_arr[$val['status']],
'wxgr_name' => $wxgrAry[$val['wxgr']],
'brand_detail' => $brand_detail,
'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '',
'biz_poi' => $area ? "{$area['province_name']}-{$area['city_name']}-{$area['county_name']}" : '',
'biz_name' => isset($biz_rows[$val['biz_id']]) ? $biz_rows[$val['biz_id']][0]['biz_name'] : '',
'c_time' => $val['c_time'] != '0' ? date('Y-m-d H:i:s', $val['c_time']) : '',
'p_time' => $val['p_time'],
'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '',
'is_unlock' => $is_unlock
);
}
}
@@ -137,7 +157,8 @@ class Customer extends HD_Controller
$this->data['status_arr'] = $status_arr;
$this->data['qdjl_lists'] = $qdjl_lists;
$this->data['provinces'] = $this->province_ary();
$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
//$this->data['export_button'] = SUPER_ADMIN == $this->role ? 1 : 0;
$this->data['export_button'] = 1;
$this->data['_title'] = '客户列表';
return $this->show_view('receiver/customer/lists', true);
}
@@ -428,6 +449,9 @@ class Customer extends HD_Controller
!$params['tags'] && $params['tags'] = '';
!$params['tagsIntention'] && $params['tagsIntention'] = '';
!$params['tagsDefeat'] && $params['tagsDefeat'] = '';
!$params['brand_id'] && $params['brand_id'] = 0;
!$params['series_id'] && $params['series_id'] = 0;
$where = array('status>=0' => null);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
@@ -440,13 +464,16 @@ class Customer extends HD_Controller
$where["biz_id in(select id from lc_biz where type={$params['biz_type']})"] = null;
}
if ($params['cid']) {
$where["{$params['search_tp']} like '{$params['cid']}'"] = null;
$where["{$params['search_tp']} like '%{$params['cid']}%'"] = null;
}
if ($params['level']) {
$where['level'] = $params['level'];
}
if (is_numeric($params['c_brand'])) {
$where['c_brand'] = $params['c_brand'];
if ($params['brand_id']) {
$where['brand_id'] = $params['brand_id'];
}
if ($params['series_id']) {
$where['series_id'] = $params['series_id'];
}
if ($params['of_id']) {
$where['of_id'] = $params['of_id'];
@@ -475,6 +502,7 @@ class Customer extends HD_Controller
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
strlen($params['status']) && $where["status"] = $params['status'];
!strlen($params['status']) && $params['status'] = '';
if ($params['qdjl_id']) {
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
@@ -532,6 +560,11 @@ class Customer extends HD_Controller
$order_time[0] && $where["def_time >="] = $order_time[0] . ' 00:00:00';
$order_time[1] && $where["def_time <="] = $order_time[1] . ' 23:59:59';
}
if ($params['unlock_time']) {
$p_time = explode(' ~ ', $params['unlock_time']);
$p_time[0] && $where["unlock_time >="] = $p_time[0] . ' 00:00:00';
$p_time[1] && $where["unlock_time <="] = $p_time[1] . ' 23:59:59';
}
if ($params['tags']) {
$where = $this->tagWhere($where, $params['tags']);
@@ -547,7 +580,11 @@ class Customer extends HD_Controller
$vdststus_parm = $vdststus ? " and lc_vd.status = {$vdststus}" : "";
$where["id in(select lc_vd.c_id from lc_receiver_customer_visit_data lc_vd join lc_receiver_customer_visit_sales lc_vs on lc_vd.biz_id = lc_vs.biz_id and lc_vd.sales_id = lc_vs.sales_id and lc_vd.t_day = lc_vs.t_day and lc_vs.id = {$vsid} {$vdststus_parm})"] = null;
}
if ($this->admin_biz_str) {
$where["biz_id in ($this->admin_biz_str)"] = null;
} else {
$this->belong && $where["biz_id in(select id from lc_biz where province_id=" . $this->limit_province_id . ")"] = null;
}
return $where;
}
@@ -598,12 +635,24 @@ class Customer extends HD_Controller
$area = $this->area_model->get(array('province_id' => $row['province_id']));
$poi = "{$area['province_name']}";
}
$brand_detail = '';
if ($row['brand_id']) {
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']]);
$brand && $brand_detail = $brand['name'];
}
if ($row['series_id']) {
$series = $this->auto_series_model->get(['id' => $row['series_id']]);
$series && $brand_detail .= '-' . $series['name'];
}
$paic_user = '';
if ($row['cf_pid']) {
$paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]);
}
$info = array(
'id' => $row['id'],
'name' => $row['name'],
'level' => $row['level'],
'mobile' => $mobile_sub,
'mobile' => $this->get_mobile(['of_id' => $row['of_id'], 'mobile' => $mobile_sub]),
'of_title' => $of_title,
'wx_name' => $this->customers_model->wxgrAry($row['wxgr']),
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
@@ -615,6 +664,9 @@ class Customer extends HD_Controller
'poi' => $poi,
'biz' => $row_biz['biz_name'],
'time_name' => $row['clue_id'] ? '派单时间' : '建档时间',
'brand_detail' => $brand_detail,
'role' => $this->role,
'cf_name' => $paic_user ? $paic_user['name'] : ''
);
//到店信息
@@ -634,16 +686,7 @@ class Customer extends HD_Controller
//操作日志
$logs = array();
foreach ($rows_log as $key => $value) {
$rec_text = $rec_url = '';
if ($value['type'] == 2) {
$rec_row = $this->receiver_yx_model->get(['id' => $value['log']], 'rec_url,duration');
if ($rec_row['duration']) {
$rec_row['rec_url'] && $rec_url = get_yx_video($rec_row['rec_url']);
!$rec_row['rec_url'] && $rec_text = '录音暂未生成';
} else {
$rec_text = '未接通';
}
}
list($rec_url, $rec_text) = $this->customer_oplogs_model->getRecordUrl($value['id']);
$imgs = [];
if ($value['imgs']) {
$json_imgs = json_decode($value['imgs'], true);
@@ -907,7 +950,7 @@ class Customer extends HD_Controller
#$where["cs_biz_id >= 0"] = null;
$page = 1;
$size = 10000;
$params['export_tag'] && $size = 500;
//$params['export_tag'] && $size = 500;
$indexs = [
'id' => 'ID',
@@ -917,19 +960,23 @@ class Customer extends HD_Controller
'status_name' => '客户状态',
'city_name' => '所在城市',
'county_name' => '所在地区',
'to_send' => '是否改派',
'is_unlock' => '是否解锁',
'unlock_time' => '解锁时间',
// 'to_send' => '是否改派',
'c_time' => '建档时间',
"p_time" => "派单时间",
"sales_p_time" => "分配时间",
"dt_time" => "到店时间",
"order_time" => "下单时间",
"cont_time" => "最后联系时间",
"u_time" => "最后操作时间",
"of_title_1" => "来源1",
"of_title_2" => "来源2",
"biz_name" => "归属门店",
"admin_name" => "归属顾问",
"wxgr_name" => "加个微",
'brand_detail' => '关注品牌',
'series_detail' => '关注车型'
];
$count = $this->customers_model->count($where);
$data = [];
@@ -937,10 +984,12 @@ class Customer extends HD_Controller
$status_arr = $this->customers_model->get_status();
unset($status_arr['-1']);
if ($count) {
$fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name";
$fileds = "id, name, mobile, level, status, cs_biz_id,brand_id,series_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, sales_p_time, if(order_time>0, order_time,'') as order_time, u_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name,un_lock,rid,unlock_time";
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
$brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id'));
$series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id'));
foreach ($rows as $key => $val) {
$of_title = '';
$brand_detail = $series_detail = $of_title = '';
$of_title_1 = $of_title_2 = '';
if ($val['of_id']) {
$of_ary = $offlineSources[$val['of_id']];
@@ -949,11 +998,20 @@ class Customer extends HD_Controller
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
$val['of2_id'] && $of_ary['list'][$val['of2_id']] && $of_title_2 = $of_ary['list'][$val['of2_id']];
}
if ($brands[$val['brand_id']]) {
$brand_detail = $brands[$val['brand_id']][0]['name'];
$series_detail = $series[$val['series_id']][0]['name'];
}
$clues = $this->clues_model->get(['id' => $val['rid']]);
$is_unlock = '';
if ($clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
$is_unlock = Receiver_customers_model::LOCK_LIST[$val['un_lock']];
}
$id = $val['id'];
$row = array(
'id' => $id,
'name' => $val['name'],
'mobile' => $val['mobile'],
'mobile' => $this->get_mobile(['of_id' => $val['of_id'], 'mobile' => $val['mobile']]),
'level' => $val['level'],
'status_name' => $status_arr[$val['status']],
'city_name' => $val['city_name'],
@@ -961,14 +1019,19 @@ class Customer extends HD_Controller
'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0),
'c_time' => $val['c_time'],
'dt_time' => $val['dt_time'],
'sales_p_time' => $val['sales_p_time'],
'p_time' => $val['p_time'],
'order_time' => $val['order_time'],
'cont_time' => $val['cont_time'],
'u_time' => $val['u_time'],
'of_title_1' => $of_title_1,
'of_title_2' => $of_title_2,
'biz_name' => $val['biz_name'],
'admin_name' => $val['admin_name'],
'wxgr_name' => $this->customers_model->wxgrAry($val['wxgr']),
'brand_detail' => $brand_detail,
'series_detail' => $series_detail,
'is_unlock' => $is_unlock,
'unlock_time' => $val['unlock_time'] != '0000-00-00 00:00:00' ? $val['unlock_time'] : '',
);
if ($params['export_tag']) {
@@ -1185,5 +1248,15 @@ class Customer extends HD_Controller
return $show;
}
private function get_mobile($params)
{
$mobile = $params['mobile'];
if (!$mobile) {
return '';
} elseif (in_array($params['of_id'], [1, 2]) && $this->role != 1) {
return mobile_asterisk($mobile);
} else {
return $mobile;
}
}
}
+51 -8
View File
@@ -34,15 +34,39 @@ class Orders extends HD_Controller
$statusAry = $this->receiver_orders_model->get_status();
$status_arr = array();
foreach ($statusAry as $key => $value) {
$count = $this->receiver_orders_model->count(['status' => $key]);
$where = ['status' => $key];
if ($this->admin_biz_str) {
$where["biz_id in ($this->admin_biz_str)"] = null;
}
$count = $this->receiver_orders_model->count($where);
$status_arr[] = array("id" => $key, "name" => $value, "cate" => [], "count" => $count);
}
$params['count_all'] = $this->receiver_orders_model->count(['status>=' => 0]);//全部
$where = ['status>=' => 0];
if ($this->admin_biz_str) {
$where["biz_id in ($this->admin_biz_str)"] = null;
}
$params['count_all'] = $this->receiver_orders_model->count($where);//全部
$params['list_type'] = 'all';
if ($this->admin_biz_str) {
$params['admin_biz_str'] = $this->admin_biz_str;
}
$result = $this->orderslist->lists($params['status_pid'], $params);
$this->data = $result;
//获取品牌
$brand_rows = $this->auto_brand_model->select(['status>' => 0], 'initial asc', 0, 0, 'id,name');
$brands = [];
if ($brand_rows) {
foreach ($brand_rows as $v) {
$brands[] = array(
'id' => $v['id'],
'name' => $v['name'],
);
}
}
$this->data['brands'] = $brands;
$this->data['provinces'] = $this->province_ary();
$this->data['status_arr'] = $status_arr;
$this->data['cps_types'] = Receiver_orders_model::CPS_TYPES;
$this->data['_title'] = '订单列表';
return $this->show_view('receiver/order/lists', true);
}
@@ -253,7 +277,8 @@ class Orders extends HD_Controller
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
$row['of_title'] = $of_title;
}
$row['money_json'] = json_decode($row['money_json'], true);
$row['p_time'] = date('Y-m-d', strtotime($customers['p_time']));
$row['money_json'] = $row['money_json'] ? json_decode($row['money_json'], true) : [];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
$row['status'] = intval($row['status']);
$row['c_time'] = date('Y-m-d', $row['c_time']);
@@ -282,14 +307,30 @@ class Orders extends HD_Controller
$contract_img[] = build_qiniu_image_url($value);
}
}
$equity_ck_img = [];
if ($img_data['equity_ck_img']) {
$img_array = explode(',', $img_data['equity_ck_img']);
foreach ($img_array as $value) {
$equity_ck_img[] = build_qiniu_image_url($value);
}
}
$img_data['equity_ck_img'] = $equity_ck_img;
$img_data['contract_img'] = $contract_img;
$img_data['car_img'] && $img_data['car_img'] = build_qiniu_image_url($img_data['car_img']);
$img_data['car_auth_img'] && $img_data['car_auth_img'] = build_qiniu_image_url($img_data['car_auth_img']);
$img_data['delivery_ck_img'] && $img_data['delivery_ck_img'] = build_qiniu_image_url($img_data['delivery_ck_img']);
$img_data['equity_ck_img'] && $img_data['equity_ck_img'] = build_qiniu_image_url($img_data['equity_ck_img']);
$img_data['bill_img'] && $img_data['bill_img'] = build_qiniu_image_url($img_data['bill_img']);
$img_data['insurance_img'] && $img_data['insurance_img'] = build_qiniu_image_url($img_data['insurance_img']);
$img_data['business_img'] && $img_data['business_img'] = build_qiniu_image_url($img_data['business_img']);
if ($img_data['insurance_img']) {
$img_data['insurance_img'] = build_qiniu_image_url($img_data['insurance_img']);
strstr($img_data['insurance_img'], '.pdf') && $img_data['insurance_pdf'] = $img_data['insurance_img'];
}
if ($img_data['business_img']) {
$img_data['business_img'] = build_qiniu_image_url($img_data['business_img']);
strstr($img_data['business_img'], '.pdf') && $img_data['business_pdf'] = $img_data['business_img'];
}
$row['img_data'] = $img_data;
//获取销售员
if ($row['sale_id']) {
@@ -460,7 +501,9 @@ class Orders extends HD_Controller
} else {
$re_data_id = $re_data['id'];
}
$field == 'contract_img' && $save_value = $re_data[$field] ? $re_data[$field] . ',' . $value : $value;
if ($field == 'contract_img' || $field == 'equity_ck_img') {
$save_value = $re_data[$field] ? $re_data[$field] . ',' . $value : $value;
}
if ($field == 'ins_img') {
$val_arr = json_decode($re_data[$field], true);
$val_arr[] = $value;
@@ -536,7 +579,7 @@ class Orders extends HD_Controller
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if ($info['field'] == 'contract_img') {
if ($info['field'] == 'contract_img' || $info['field'] == 'equity_ck_img') {
$img_array = explode(',', $row[$info['field']]);
$new_imgs = [];
foreach ($img_array as $item) {
+303
View File
@@ -0,0 +1,303 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Report extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("biz/biz_model");
$this->load->model("biz/biz_report_day_model");
// $this->load->model('receiver/receiver_score_log_model');
// $this->load->model('receiver/receiver_score_day_model');
// $this->load->model('receiver/receiver_score_avg_day_model');
// $this->load->model('app/licheb/app_licheb_users_model');
// $this->load->model('receiver/receiver_customers_model');
// $this->load->model('receiver/order/receiver_orders_model');
// $this->load->model('receiver/order/receiver_order_datas_model');
}
//首页信息
public function index()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
// $biz_where = ['status' => 1, 'type' => 0, 'province_id' => 350000];
$biz_where = ['status' => 1, 'type in (1,2)' => null, 'province_id' => 350000];
$biz_lists = $this->biz_model->select($biz_where, '', 0, 0, 'id,biz_name');
$params['size'] = count($biz_lists) ?: 20;
$lists = array();
$where = ["status<>-1" => null];
if ($params['day']) {
$where['day'] = $params['day'];
} else {
$where['day'] = date('Y-m-d', strtotime('yesterday'));
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
}
$count = $this->biz_report_day_model->count($where);
$map_biz_lists = array_column($biz_lists, null, 'id');
if ($count) {
$res = $this->biz_report_day_model->select($where, "id desc", $params['page'], $params['size']);
foreach ($res as $value) {
$setValue = $value;
$biz = $map_biz_lists[$value['biz_id']];
$setValue['biz_name'] = $biz['biz_name'];
$lists[] = $setValue;
}
}
//获取所有
$this->data['biz_lists'] = $biz_lists;
$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('receiver/report/lists', true);
}
//数据列表
public function lists()
{
}
//展示单条数据
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
public function export()
{
$params = $this->input->get();
$day = $params['day'];
!$day && $day = date('Y-m-d', strtotime('yesterday'));
$indexs = [
'biz_name' => '车卖场',
'sales' => '顾问数(含店长)',
'work_per' => '今日开工率',
'cust_new' => '今日新增线索数',
"cust_push" => "今日未及时分配数",
'cust_visit' => '今日新增跟进数',
"cust_delay" => "今日线索逾期数",
"cust_defeat" => "今日战败申请未处理数",
'order_new' => '今日订单新增数',
"order_wrong" => "今日订单未达T+1",
"order_early" => "今日开票早与订单时间数",
'score' => '今日运营分',
'cust_month' => '本月线索总数',
"cust_push_month" => "本月未及时分配总数",
'cust_visit_month' => '本月跟进客户数',
"cust_delay_month" => "本月线索逾期数",
"cust_defeat_month" => "本月战败申请未处理数",
'order_month' => '本月订单总数',
"order_wrong_month" => "本月订单未达T+1",
'order_over' => "本月交付总数",
"order_finish" => "本月订单信息完整数",
'score_month' => '本月运营分',
];
$lists = [];
$where = ["status<>-1" => null];
if ($params['day']) {
$where['day'] = $params['day'];
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
}
$res = $this->biz_report_day_model->select($where, "id desc", $params['page'], $params['size']);
$map_biz_lists = $this->biz_model->get_map_by_ids(array_column($res, 'biz_id'), 'id,biz_name');
foreach ($res as $value) {
$setValue = $value;
$biz = $map_biz_lists[$value['biz_id']][0];
$setValue['biz_name'] = $biz['biz_name'];
$lists[] = $setValue;
}
$fileName = '车卖场日报';
array_unshift($lists, $indexs);
$this->load->library('excel');
$this->excel->out_csv($lists, $indexs, $fileName . "_" . date('YmdHis'));
}
//导出数据列表
// public function export()
// {
// $day = $this->input->get('day');
// !$day && $day = date('Y-m-d', strtotime('yesterday'));
// $month = date('m', strtotime($day));
//
// $indexs = [
// 'biz_name' => '车卖场',
// 'sales' => '顾问数(含店长)',
// 'work_per' => '今日开工率',
// 'cust_new' => '今日新增线索数',
// "cust_push" => "今日未及时分配数",
// 'cust_visit' => '今日新增跟进数',
// "cust_delay" => "今日线索逾期数",
// "cust_defeat" => "今日战败申请未处理数",
// 'order_new' => '今日订单新增数',
// "order_wrong" => "今日订单未达T+1",
// "order_early" => "今日开票早与订单时间数",
// 'score' => '今日运营分',
//
// 'cust_month' => '本月线索总数',
// "cust_push_month" => "本月未及时分配总数",
// 'cust_visit_month' => '本月跟进客户数',
// "cust_delay_month" => "本月线索逾期数",
// "cust_defeat_month" => "本月战败申请未处理数",
// 'order_month' => '本月订单总数',
// "order_wrong_month" => "本月订单未达T+1",
// 'order_over' => "本月交付总数",
// "order_finish" => "本月订单信息完整数",
// 'score_month' => '本月运营分',
// ];
//
// $where = array(
// 'status' => 1,
// 'type' => 0,
// 'province_id' => 350000
// );
// $bizs = $this->biz_model->select($where, '', 0, 0, 'id, biz_name');
// if($bizs){
// foreach ($bizs as $v){
// //开工率
// $sales = $this->app_licheb_users_model->count(array('group_id in (1,2)' => null, 'biz_id' => $v['id'], 'status' => 1));
// $works = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 0, 'sub_type' => 0, 'score >' => 0));
//
// //今日新增线索数
// $cust_new = $this->receiver_customers_model->count(array('biz_id' => $v['id'], 'DATE(p_time)' => $day));
//
// //本月线索总数
// $cust_month = $this->receiver_customers_model->count(array('biz_id' => $v['id'], 'MONTH(p_time)' => $month));
//
// //今日新增跟进数
// $cust_visit = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0));
//
// //本月跟进客户数
// $cust_visit_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 1, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
//
// //今日订单新增数
// $order_new = $this->receiver_orders_model->count(array('DATE(order_time)' => $day, 'biz_id' => $v['id'], 'status >=' => 0));
//
// //本月订单总数
// $order_month = $this->receiver_orders_model->select(array('MONTH(order_time)' => $month, 'biz_id' => $v['id'], 'status >=' => 0), '', 0, 0, 'id');
//
//
// //本月订单信息完整数
// if($order_month){
// $oids = implode(',', array_unique(array_column($order_month, 'id')));
//
// $where = array(
// "o_id in ({$oids})" => null,
// "((cardida != '' AND cardidb != '') OR (business_licence != ''))" => null,
// "pay_img <>" => '',
// "contract_img <>" => '',
// "bill_img <>" => '',
// "car_img <>" => '',
// "insurance_img <>" => '',
// "business_img <>" => '',
// );
// $order_finish = $this->receiver_order_datas_model->count($where);
// }else{
// $order_finish = 0;
// }
//
// //今日线索逾期数
// $cust_delay = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
//
// //本月线索逾期数
// $cust_delay_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 3, 'target_id >' => 0));
//
// //今日订单未达T+1
// $order_wrong = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
//
// //本月订单未达T+1
// $order_wrong_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 2, 'target_id >' => 0), 'target_id');
//
// //今日开票早与订单时间数
// $order_early = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 1, 'target_id >' => 0), 'target_id');
//
// //今日未及时分配数
// $cust_push = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
//
// //本月未及时分配数
// $cust_push_month = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 4, 'target_id >' => 0), 'target_id');
//
// //今日战败申请未处理数
// $cust_defeat = $this->receiver_score_log_model->count(array('day' => $day, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
//
// //本月战败申请未处理数
// $cust_defeat_moth = $this->receiver_score_log_model->count(array('MONTH(day)' => $month, 'biz_id' => $v['id'], 'type' => 3, 'sub_type' => 5, 'target_id >' => 0), 'target_id');
//
// //本月交付总数
// $order_over = $this->receiver_orders_model->count(array('MONTH(over_time)' => $month, 'biz_id' => $v['id'], 'status >' => 0));
//
// //今日运营分
// $score = $this->receiver_score_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'type' => 1));
//
// //本月运营分
// $score_month = $this->receiver_score_avg_day_model->get(array('day' => $day, 'biz_id' => $v['id'], 'uid' => 0));
//
// $data[] = array(
// 'biz_name' => $v['biz_name'],
// 'sales' => $sales,
// 'work_per' => number_format($works/$sales, 2) * 100 .'%',
// 'cust_new' => $cust_new,
// 'cust_push' => $cust_push,
// 'cust_visit' => $cust_visit,
// 'cust_delay' => $cust_delay,
// 'cust_defeat' => $cust_defeat,
// 'order_new' => $order_new,
// 'order_wrong' => $order_wrong,
// 'order_early' => $order_early,
// 'score' => round($score['score']),
//
// 'cust_month' => $cust_month,
// 'cust_push_month' => $cust_push_month,
// 'cust_visit_month' => $cust_visit_month,
// 'cust_delay_month' => $cust_delay_month,
// 'cust_defeat_month' => $cust_defeat_moth,
// 'order_month' => count($order_month),
// 'order_wrong_month' => $order_wrong_month,
// 'order_over' => $order_over,
// 'order_finish' => $order_finish,
// 'score_month' => round($score_month['score']),
// );
// }
// }
//
// $fileName = '车卖场日报';
// array_unshift($data, $indexs);
// $this->load->library('excel');
// $this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
// }
}
+107
View File
@@ -0,0 +1,107 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Notice extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('sys/sys_notice_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$page = $this->input->get('page') ?: 1;
$pageSize = 20;
$where = [
'platform' => Sys_notice_model::PLAT_FORM_ADMIN,
'uid' => $this->uid
];
strlen($params['read']) && $where['read'] = intval($params['read']);
$count = $this->sys_notice_model->count($where);
$list = [];
if ($count) {
$rows = $this->sys_notice_model->select($where, 'id desc', $page, $pageSize);
foreach ($rows as $item) {
$list[] = [
'id' => $item['id'],
'icon' => Sys_notice_model::ICON_TYPE[$item['icon']] ?: Sys_notice_model::ICON_DEFAULT,
'content' => $item['content'],
'url' => $item['url'],
'read' => intval($item['read']),
'readCn' => $item['read'] ? '已读' : '未读',
'type' => $item['type'],
'c_time' => date('Y-m-d H:i:s', $item['c_time'])
];
}
}
$this->data['params'] = $params;
$this->data['readList'] = Sys_notice_model::READ_STATUS;
$this->data['lists'] = $list;
$this->data['_title'] = '系统消息';
$this->data['pager'] = array('count' => ceil($count / $pageSize), 'curr' => $page, 'totle' => $count);
$this->show_view('sys/notice/lists', true);
}
public function add()
{
}
public function get()
{
}
public function edit()
{
}
public function batch()
{
}
public function export()
{
}
public function del()
{
}
public function edit_read()
{
$id = $this->input->post('id');
$field = $this->input->post('field');
$value = $this->input->post('value');
$read = $this->input->post('read');
if ('read' == $field) {
$read = $value;
}
$upd = array('read' => $read);
$where = ['uid' => $this->uid, 'platform' => Sys_notice_model::PLAT_FORM_ADMIN];
if (is_numeric($id)) {
$where['id'] = $id;
} else {
$where["id in ({$id})"] = null;
}
$ret = $this->sys_notice_model->update($upd, $where);
if (!$ret) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
}
+107
View File
@@ -0,0 +1,107 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Vlog extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('biz/biz_visit_log_model');
$this->load->model('biz/biz_model');
$this->load->model("sys/sys_admin_model");
$this->load->model('app/licheb/app_licheb_users_model', 'app_user_model');
}
public function index()
{
$typeAry = $this->biz_model->type_ary();
$this->data['typeAry'] = $typeAry;
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$page = $this->input->get('page');
!$page && $page = 1;
$pageSize = 20;
$where = [];
if ($params['user_name']) {
$uids = 0;
$userList = $this->app_user_model->select(["uname like '%{$params['user_name']}%'" => null], '', '', '', 'id,uname');
if ($userList) {
$uids = implode(',', array_column($userList, 'id'));
}
$where["uid in ($uids)"] = null;
}
if ($params['biz_name']) {
$bizs = 0;
$bizList = $this->biz_model->select(["biz_name like '%{$params['biz_name']}%'" => null], '', '', '', 'id,biz_name');
if ($bizList) {
$bizs = implode(',', array_column($bizList, 'id'));
}
$where["biz_id in ($bizs)"] = null;
}
if ($params['type']) {
$type = intval($params['type']);
$where["biz_id in (select id from lc_biz where type={$type})"] = null;
}
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["createTime >="] = $c_time[0] . ' 00:00:00';
$c_time[1] && $where["createTime <="] = $c_time[1] . ' 23:59:59';
}
$rows = $this->biz_visit_log_model->select($where, 'id desc', $page, $pageSize);
$count = $this->biz_visit_log_model->count($where);
$list = [];
if ($rows) {
$bizIds = implode(',', array_unique(array_column($rows, 'biz_id')));
!$bizIds && $bizIds = 0;
$bizs = $this->biz_model->map('id', 'biz_name', ["id in ({$bizIds})" => null]);
$userIds = implode(',', array_unique(array_column($rows, 'uid')));
!$userIds && $userIds = 0;
$users = $this->app_user_model->map('id', 'uname', ["id in ({$userIds})" => null]);
foreach ($rows as $v) {
$v['url'] = explode('?', $v['url'])[0];
$v['biz_name'] = $bizs[$v['biz_id']] ?: '';
$v['username'] = $users[$v['uid']] ?: '';
$list[] = $v;
}
}
$this->data['params'] = $params;
$this->data['lists'] = $list;
$this->data['_title'] = '小程序访问日志';
$this->data['pager'] = array('count' => ceil($count / $pageSize), 'curr' => $page, 'totle' => $count);
$this->show_view('sys/vlog/lists', true);
}
public function add()
{
}
public function get()
{
}
public function edit()
{
}
public function batch()
{
}
public function export()
{
}
public function del()
{
}
}
+13
View File
@@ -24,6 +24,7 @@ class Admin extends HD_Controller {
$mobile = $this->input->get('mobile');
$status = $this->input->get('status');
$role_id = $this->input->get('role_id');
$belong_id = $this->input->get('belong_id');
$page = $this->input->get('page') ? $this->input->get('page') : 1;
$status = $status === null ? 1 : $status;
if(!empty($username)) $where["username like '%$username%'"] = null;
@@ -37,7 +38,9 @@ class Admin extends HD_Controller {
foreach ($data as $key => $value) {
$data[$key]['role'] = $role[$value['role_id']]['name'];
}
$this->data['role'] = $role;
$this->data['belong_id'] = $belong_id;
$this->data['role_id'] = $role_id;
$this->data['pager'] = ['count' => ceil($count/$size),'curr' => $page,'totle' => $count];
$this->data['lists'] = $data;
@@ -93,7 +96,9 @@ class Admin extends HD_Controller {
}
$this->data['username'] = $data['username'];
$this->data['role_id'] = $data['role_id'];
$this->data['belong_id'] = $json['belong_id'];
$this->data['mobile'] = $data['mobile'];
$this->data['kf_mobile'] = $data['kf_mobile'];
$this->data['id'] = $id;
$this->load->vars('url','edit');
$this->show_view('/sys/admin/edit');
@@ -137,6 +142,7 @@ class Admin extends HD_Controller {
$input = $this->_get_input();
$other_json = [];
$input['biz_id'] && $other_json['biz_id'] = $input['biz_id'];
$input['belong_id'] && $other_json['belong_id'] = $input['belong_id'];
$insert = [
'username' => $input['username'],
'mobile' => $input['mobile'],
@@ -144,6 +150,7 @@ class Admin extends HD_Controller {
'other_json' => json_encode($other_json,JSON_UNESCAPED_UNICODE),
'password' => password_hash($input['password1'],PASSWORD_BCRYPT),
'c_time' => time(),
'kf_mobile' => $input['kf_mobile'],
];
$this->sysAdmin->add($insert);
return $this->show_json(SYS_CODE_SUCCESS,'新增成功!');
@@ -160,11 +167,13 @@ class Admin extends HD_Controller {
$input = $this->_get_input();
$other_json = [];
$input['biz_id'] && $other_json['biz_id'] = $input['biz_id'];
$input['belong_id'] && $other_json['belong_id'] = $input['belong_id'];
$upd = [
'username' => $input['username'],
'mobile' => $input['mobile'],
'role_id' => $input['role'],
'other_json' => json_encode($other_json,JSON_UNESCAPED_UNICODE),
'kf_mobile' => $input['kf_mobile'],
];
if($this->sysAdmin->update($upd,['id' => $input['id']])) {
return $this->show_json(SYS_CODE_SUCCESS,'修改成功!');
@@ -196,6 +205,8 @@ class Admin extends HD_Controller {
private function _get_info()
{
$data['role'] = $this->sysRole->select(['status' => '1'],'','','','id,name');
$data['belong'] = $this->biz_model->select(['status' => 1, 'type' => 1],'','','','id,biz_name');
return $data;
}
@@ -250,8 +261,10 @@ class Admin extends HD_Controller {
'id' => $this->input->post('id'),
'username' => trim($this->input->post('username')),
'mobile' => trim($this->input->post('mobile')),
'kf_mobile' => trim($this->input->post('kf_mobile')),
'status' => $this->input->post('status'),
'role' => $this->input->post('role'),
'belong_id' => $this->input->post('belong_id'),
'password1' => trim($this->input->post('password1')),
'password2' => trim($this->input->post('password2')),
'biz_id' => $this->input->post('biz_id'),
+143
View File
@@ -0,0 +1,143 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Brand extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model("sys/sys_cps_model");
$this->load->model("auto/auto_brand_model");
}
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;
!strlen($params['status']) && $params['status'] = '';
!strlen($params['type']) && $params['type'] = '';
$lists = array();
$where = [];
strlen($params['status']) && $where['status'] = intval($params['status']);
strlen($params['type']) && $where['type'] = intval($params['type']);
$status_lists = Sys_cps_model::STATUS_LISTS;
$type_lists = Sys_cps_model::TYPES;
$count = $this->sys_cps_model->count($where);
if ($count) {
$res = $this->sys_cps_model->select($where, "id desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$brand = $this->auto_brand_model->get(['id' => $value['brand_id']]);
$value['brand_name'] = $brand['name'];
$value['type_name'] = Sys_cps_model::TYPES[$value['type']];
$value['status_name'] = $status_lists[$value['status']];
$lists[] = $value;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['status_lists'] = $status_lists;
$this->data['type_lists'] = $type_lists;
$this->data['_title'] = 'cps列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->show_view('sys/cps/lists', true);
}
public function get()
{
$id = intval($this->input->get('id'));
$info = ['brand_id' => '', 'type' => Sys_cps_model::TYPE_IMPORTANT];
if ($id) {
$info = $this->sys_cps_model->get(['id' => $id]);
}
$brand_rows = $this->auto_brand_model->select(['status' => 1], 'initial asc', 0, 0, 'id,name');
$brands = [];
if ($brand_rows) {
foreach ($brand_rows as $v) {
$brands[] = array(
'id' => $v['id'],
'name' => $v['name'],
);
}
}
$this->data['brands'] = $brands;
$this->data['info'] = $info;
$this->data['types'] = Sys_cps_model::TYPES;
$this->data['_title'] = $id ? '编辑' : '新增';
return $this->show_view('sys/cps/edit', true);
}
public function add()
{
$info = $this->input->post();
if (!$info['brand_id'] || !$info['type'] || !$info['s_time'] || !$info['e_time']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$data = [
'brand_id' => $info['brand_id'],
'type' => $info['type'],
's_time' => $info['s_time'],
'e_time' => $info['e_time'],
'c_time' => time()
];
$res = $this->sys_cps_model->add($data);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function edit()
{
$info = $this->input->post();
$row = $this->sys_cps_model->get(['id' => $info['id']]);
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
$up_data = [
'brand_id' => $info['brand_id'],
'type' => $info['type'],
's_time' => $info['s_time'],
'e_time' => $info['e_time'],
];
$res = $this->sys_cps_model->update($up_data, ['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()
{
return false;
}
public function export()
{
return false;
}
public function edit_status()
{
$id = $this->input->post('id');
$row = $this->sys_cps_model->get(['id' => $id]);
if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在');
$status = $row['status'] ? 0 : 1;
$up_data = [
'status' => $status
];
$res = $this->sys_cps_model->update($up_data, ['id' => $id]);
if (!$res) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
}
+90
View File
@@ -0,0 +1,90 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Callconfig extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('sys/sys_config_model', 'confModel');
}
public function index()
{
return $this->get();
}
public function lists()
{
}
public function get()
{
$row = $this->confModel->get(array('k' => Sys_config_model::CALL_CONFIG_KEY));
if (!$row) {
$addData = array(
'k' => Sys_config_model::CALL_CONFIG_KEY,
'v' => json_encode([], JSON_UNESCAPED_UNICODE),
'c_time' => time(),
);
$id = $this->confModel->add($addData);
if (!is_numeric($id)) {
$this->show_json(SYS_CODE_FAIL, '添加失败');
}
$row = $addData;
$row['id'] = $id;
}
$this->data['id'] = $row['id'];
$this->data['row'] = json_decode($row['v'], true);
$this->data['_title'] = '外呼配置';
$this->show_view('sys/site/callConfig/edit', true);
}
public function add()
{
}
public function edit()
{
$input = $this->input->post();
$row = $this->confModel->get(array('id' => $input['id']));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '提交错误');
}
$callTime = intval($input['callTime']);
$callbackTime = intval($input['callbackTime']);
if (!$callTime || $callbackTime <= 0) {
return $this->show_json(SYS_CODE_FAIL, '请输入正确的外呼绑定时长');
}
if (!$callbackTime || $callbackTime <= 0) {
return $this->show_json(SYS_CODE_FAIL, '请输入正确的回拨绑定时长');
}
$jsonData = json_decode($row['v'], true);
$jsonData['callBackPhoneNo'] = $input['callBackPhoneNo'] ?: '';
$jsonData['callTime'] = $callTime;
$jsonData['callbackTime'] = $callbackTime;
$re = $this->confModel->update(array('v' => json_encode($jsonData, JSON_UNESCAPED_UNICODE)), array('id' => $input['id']));
if ($re) {
return $this->show_json(SYS_CODE_SUCCESS, '编辑成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '编辑失败');
}
}
public function del()
{
}
public function batch()
{
}
public function export()
{
}
}
+68
View File
@@ -0,0 +1,68 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Wss extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('ws/ws_conn_model');
$this->load->model('sys/sys_notice_model');
}
public function index()
{
$this->data['platformList'] = Sys_notice_model::PLATFORM_LIST;
$this->data['_title'] = '消息推送工具';
$this->show_view('sys/utils/wss/index', true);
}
public function lists()
{
}
public function add()
{
$info = $this->input->post();
if (!$info['uid'] || !$info['content'] || !$info['platform']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$params = [
'platform' => $info['platform'],
'uid' => $info['uid'],
'content' => $info['content'],
];
$params['url'] = $info['url'] ?: '';
$endPlatform = Ws_conn_model::PLAT_FORM_SYS_ADMIN;
/** @var MyResponse $req */
$req = $this->sys_notice_model->addNotice($params, $endPlatform, 8888888, true);
if (!$req->isSuccess()) {
return $this->show_json(SYS_CODE_FAIL, $req->getMessage());
}
return $this->show_json(SYS_CODE_SUCCESS, '发送成功');
}
public function get()
{
}
public function edit()
{
}
public function batch()
{
}
public function export()
{
}
public function del()
{
}
}
+178
View File
@@ -0,0 +1,178 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Mobile extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('sys/sys_yx_mobiles_model');
$this->load->model('area_model');
$this->load->model('sys/sys_admin_model');
}
public function index()
{
return $this->lists();
}
public function lists($where = array(), $order = 'id desc', $page = 0, $size = 10)
{
$page = $this->input->post_get('page') ? $this->input->get('page') : 1;
$params = $this->input->get();
$where['status>='] = 0;
if ($params['mobile']) {
$where["mobile like '%{$params['mobile']}%'"] = null;
}
$count = $this->sys_yx_mobiles_model->count($where);
$lists = [];
if ($count) {
$rows = $this->sys_yx_mobiles_model->select($where, $order, $page, $size);
foreach ($rows as $row) {
$tmp = $row;
$city = $this->area_model->get(['city_id' => $row['city_id']]);
$tmp['province_name'] = $city['province_name'];
$tmp['city_name'] = $city['city_name'];
$admin = '';
if ($row['admin_id']) {
$admin = $this->sys_admin_model->get(['id' => $row['admin_id']]);
}
$tmp['admin_name'] = $admin ? $admin['username'] : '未绑定';
$lists[] = $tmp;
}
}
$this->data['pager'] = array('count' => '', 'curr' => $page, 'totle' => $count, 'total' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '云信虚拟号管理';
$this->show_view('sys/yx/lists', true);
}
public function get()
{
$id = $this->input->get('id');
$row = [];
$url = 'add';
if ($id) {
$row = $this->sys_yx_mobiles_model->get(['id' => $id]);
$url = 'edit';
}
$this->data['url'] = $url;
$this->data['row'] = $row;
$this->show_view('sys/yx/edit');
}
public function add()
{
$input = $this->input->post();
if (!$input['mobile'] || !mobile_valid($input['mobile'])) {
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
}
if (!$input['city_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
$add = [
'mobile' => $input['mobile'],
'province_id' => $input['province_id'],
'city_id' => $input['city_id'],
'c_time' => time(),
];
$re = $this->sys_yx_mobiles_model->add($add);
if ($re) {
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
public function edit()
{
$input = $this->input->post();
$row = $this->sys_yx_mobiles_model->get(['id' => $input['id']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if (!$input['mobile'] || !mobile_valid($input['mobile'])) {
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
}
if (!$input['city_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择城市');
}
$data = [
'mobile' => $input['mobile'],
'province_id' => $input['province_id'],
'city_id' => $input['city_id'],
];
$re = $this->sys_yx_mobiles_model->update($data, ['id' => $row['id']]);
if ($re) {
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
public function batch()
{
}
public function export()
{
}
public function del()
{
}
/**
* 修改状态
* @return bool
*/
public function edit_status()
{
$id = $this->input->post('id');
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '提交失败');
}
$status = $this->input->post('status');
$update['status'] = $status;
$re = $this->sys_yx_mobiles_model->update($update, array('id' => $id));
if ($re) {
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
}
public function edit_admin()
{
$id = $this->input->post_get('id');
$row = $this->sys_yx_mobiles_model->get(['id' => $id]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if ($this->input->method() == 'post') {
$admin_id = (int)$this->input->post('admin_id');
$re = $this->sys_yx_mobiles_model->update(['admin_id' => $admin_id], array('id' => $id));
if ($re) {
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
} else {
$where = [
'status' => 1,
"id not in (select admin_id from lc_sys_yx_mobiles where status>=0 and admin_id>0 and admin_id!={$row['admin_id']})" => null
];
$adminLists = $this->sys_admin_model->select($where, 'id desc', 0, 0, 'id,username,mobile');
$this->data['adminLists'] = $adminLists;
$this->data['row'] = $row;
$this->show_view('sys/yx/edit_admin');
}
}
}
+9 -3
View File
@@ -10,14 +10,17 @@ defined('BASEPATH') or exit('No direct script access allowed');
abstract class HD_Controller extends CI_Controller
{
public $uid, $user_name, $role;
public $uid, $user_name, $role, $admin_biz, $admin_biz_str, $limit_province_id;
public $data = array(), $if_ajax = false;
//开发城省份 湖南 福建
public $city_lists = array(
'430000' => ['id' => '430000', 'name' => '湖南省'],
'350000' => ['id' => '350000', 'name' => '福建省'],
'430000' => ['id' => '430000', 'name' => '湖南省'],
'520000' => ['id' => '520000', 'name' => '贵州省'],
'460000' => ['id' => '460000', 'name' => '海南省'],
'440000' => ['id' => '440000', 'name' => '广东省'],
);
public function __construct()
@@ -135,12 +138,15 @@ abstract class HD_Controller extends CI_Controller
*/
protected function province_ary()
{
$this->load->model("sys/area_model", 'area_model');
$area_where = [];
$citys = array_column($this->city_lists, 'id');
if ($citys) {
$this->load->model("sys/area_model", 'area_model');
$area_where["province_id in (" . implode(",", $citys) . ")"] = null;
}
if($this->limit_province_id){
$area_where["province_id"] = $this->limit_province_id;
}
return $this->area_model->select($area_where, '', 0, 0, 'distinct(province_id), province_name');
}
}
+60 -57
View File
@@ -6,9 +6,11 @@
* Time: 14:10
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
//session_start();
class Auth {
class Auth
{
public $uid, $username, $role;
@@ -26,27 +28,29 @@ class Auth {
$mth = $CI->router->fetch_method();
$methods = explode('_', $mth);
$action = action_node($methods[0]);
$node = DIRECTORY_SEPARATOR.$dir.$ctrl;
$node = DIRECTORY_SEPARATOR . $dir . $ctrl;
$auth_match = array(1 => 'index', 2 => 'lists', 3 => 'get', 4 => 'add', 5 => 'edit', 6 => 'del', 7 => 'batch', 8 => 'export');
$CI->load->model('sys/sys_admin_model');
$CI->load->model('sys/sys_menu_model');
$CI->load->model('sys/sys_role_model');
$CI->load->model('sys/sys_city_model');
$CI->load->model('Area_model');
$CI->load->model("biz/biz_model");
$CI->load->model('ws/ws_conn_model');
$CI->load->config('wss');
if($user_info = json_decode($user_info, true))
{
if ($user_info = json_decode($user_info, true)) {
//登录ip判断
$admin_user = $CI->sys_admin_model->get(array('id' => $user_info['id']));
$ip = get_client_ip();
$ip_arr = array();
if(SUPER_ADMIN == $admin_user['role_id']){
if (SUPER_ADMIN == $admin_user['role_id']) {
//超级管理员免检
} else if($this->is_ignore($user_info['id'])){
} else if ($this->is_ignore($user_info['id'])) {
//免检
} elseif(false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.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) && $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();
@@ -72,14 +76,14 @@ class Auth {
//权限分类筛选
$info = (array)json_decode($admin_user['other_json']);
if($admin_user['role_id'] == SUPER_ADMIN) {
if ($admin_user['role_id'] == SUPER_ADMIN) {
$_SESSION['admin_role_id'] = '0';
} else {
if($info['city_id']) {
$province = $CI->Area_model->select(['city_id in ( '.implode(',', $info['city_id']).')' => null]);
if ($info['city_id']) {
$province = $CI->Area_model->select(['city_id in ( ' . implode(',', $info['city_id']) . ')' => null]);
$city = array_column($CI->sys_city_model->select(['status' => '0']), 'city_id');
foreach ($info['city_id'] as $key => $value) {
if(in_array($value, $city)) {
if (in_array($value, $city)) {
unset($info['city_id'][$key]);
}
}
@@ -142,40 +146,31 @@ class Auth {
$role = $CI->sys_role_model->get(array('id' => $admin_user['role_id']));
$action_json = $role['action_json'] ? json_decode($role['action_json'], true) : array();
$menus = $CI->sys_menu_model->select(array("url like '" . $node . "%'" => null, 'status' => 1), "id ASC");
foreach($menus as $item) {
foreach ($menus as $item) {
if (isset($action_json[$item['id']])) {
$menu = $item;
break;
}
}
if($admin_user['role_id'] != SUPER_ADMIN && $dir)
{
if(!$admin_user['status'])
{
if ($admin_user['role_id'] != SUPER_ADMIN && $dir) {
if (!$admin_user['status']) {
return $this->returnMsg('您的账号已被禁用');
}
else
{
} else {
$menu_ids = explode(',', $role['menu_ids']);
if(!$role['status'])
{
if (!$role['status']) {
return $this->returnMsg('您的权限已被禁用');
} elseif('json' == $methods[0]){
} elseif ('json' == $methods[0]) {
//弹框等公共搜索使用,无需菜单权限校验
}
else
{
} else {
/*edit by xuxianbin 20190521 同一个url有可能对应多个节点*/
// $menu = $CI->sys_menu_model->get(array("url like '" . $node . "%'" => null, 'status' => 1));
if(!$action_json[$menu['id']])
{
if (!$action_json[$menu['id']]) {
return $this->returnMsg('系统菜单尚未创建');
}
if(!in_array($action, $action_json[$menu['id']]))
{
if (!in_array($action, $action_json[$menu['id']])) {
return $this->returnMsg('您的权限不足');
}
}
@@ -183,26 +178,20 @@ class Auth {
}
if($spm)
{
if ($spm) {
$spm_arr = explode('-', $spm);
if(!$menu_ids)
{
if (!$menu_ids) {
$role = $CI->sys_role_model->get(array('id' => $admin_user['role_id']));
$menu_ids = explode(',', $role['menu_ids']);
}
if(count($spm_arr) >= 5)
{
if (count($spm_arr) >= 5) {
$four = $CI->sys_menu_model->select(array('pid' => $spm_arr[3], 'status' => 1), 'sort desc');
if($four)
{
if ($four) {
$arr = $spm_arr;
foreach ($four as $v)
{
if($admin_user['role_id'] != SUPER_ADMIN && !in_array($v['id'], $menu_ids))
{
foreach ($four as $v) {
if ($admin_user['role_id'] != SUPER_ADMIN && !in_array($v['id'], $menu_ids)) {
continue;
}
@@ -222,14 +211,14 @@ class Auth {
//获取面包屑
$spm_arr1 = explode('-', $menu['node']);
$spm_arr1 && !is_numeric($spm_arr1[0]) && $spm_arr1 = array_slice($spm_arr1, 1);
if($spm_arr1){
$rows = $CI->sys_menu_model->select(array("id in (" . implode(",",$spm_arr1) . ")" => null, 'status' => 1), 'sort desc');
if ($spm_arr1) {
$rows = $CI->sys_menu_model->select(array("id in (" . implode(",", $spm_arr1) . ")" => null, 'status' => 1), 'sort desc');
$menu_arr = array();
$breads = array();
foreach($rows as $row){
foreach ($rows as $row) {
$menu_arr[$row['id']] = $row;
}
foreach($spm_arr1 as $v){
foreach ($spm_arr1 as $v) {
$item = $menu_arr[$v];
$breads[] = array(
'spm' => $item['node'],
@@ -246,9 +235,21 @@ class Auth {
$CI->uid = $admin_user ? $admin_user['id'] : 0;
$CI->username = $admin_user ? $admin_user['username'] : '';
$CI->role = $admin_user ? $admin_user['role_id'] : 0;
}
elseif($ctrl != 'login')
{
$other_json = $admin_user['other_json'] ? json_decode($admin_user['other_json'], true) : [];
$CI->admin_biz = $other_json['biz_id'] ? $other_json['biz_id'] : [];
$CI->belong = $other_json['belong_id'] ? $other_json['belong_id'] : 0;
$CI->admin_biz_str = $CI->admin_biz ? implode(',', $CI->admin_biz) : '';
$CI->limit_province_id = 0;
if ($CI->belong) {
$biz = $CI->biz_model->get(['id' => $other_json['belong_id']], 'province_id');
$CI->limit_province_id = $biz['province_id'];
}
$wss_url = $CI->config->item('url');
$wss_token = generateToken($CI->uid, 'jwt_key_system');
$wss_platform = Ws_conn_model::PLAT_FORM_ADMIN;
$CI->data['wss_url'] = "{$wss_url}?token={$wss_token}&platform={$wss_platform}";
} elseif ($ctrl != 'login') {
header('location:/login');
}
@@ -258,23 +259,24 @@ class Auth {
/**
* 初始化app参数
*/
public function initapp(){
public function initapp()
{
$Input = &load_class("Input", "core");
$Config = &load_class('Config', 'core');
$key_cookie = "hd_app_id";
$app_id = $Input->get_post("app_id");
if(!$app_id){
if (!$app_id) {
$app_id = $Input->cookie($key_cookie);
}
if($app_id){
if ($app_id) {
$Input->set_cookie($key_cookie, $app_id, time() + 86400);
$Config->load('app', true, true);
$configs = $Config->item('app');
$config = $configs[$app_id];
//根据应用加载库
if($config['db']){
if ($config['db']) {
$GLOBALS['app_db'] = $config['db'];
}
}
@@ -292,15 +294,16 @@ class Auth {
* @param $admin_id
* @return bool
*/
private function is_ignore($admin_id){
private function is_ignore($admin_id)
{
$CI = &get_instance();
$CI->load->model('sys/sys_config_model', 'config_model');
$where = array('k' => 'igadmin', 'v LIKE \'%"admin_id":"' .$admin_id. '"%\'' => null);
$where = array('k' => 'igadmin', 'v LIKE \'%"admin_id":"' . $admin_id . '"%\'' => null);
$exist = $CI->config_model->get($where);
if($exist){
if ($exist) {
$json = json_decode($exist['v'], true);
if($json['status']){
if ($json['status']) {
return true;
}
}
+71 -1
View File
@@ -14,6 +14,8 @@ class OrdersList
{
$this->ci = &get_instance();
$this->ci->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->ci->load->model('receiver/order/receiver_order_datas_model', 'mdOrderData');
$this->ci->load->model('receiver/order/receiver_order_datas_model');
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->ci->load->model('app/licheb/app_licheb_channel_biz_model');
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
@@ -109,6 +111,30 @@ class OrdersList
$where["bill_time <="] = $bill_time[1] . ' 23:59:59';
}
}
//是否有合同
if ($params['iscontract']) {
$where_od['contract_img <>'] = '';
$order_time[0] && $where_od['u_time >='] = $order_time[0] . ' 00:00:00';
$rows_od = $this->ci->mdOrderData->select($where_od, '', 0, 0, 'o_id');
$rows_od && $str_ids = implode(',', array_column($rows_od, 'o_id'));
if ($params['iscontract'] == 1) {
$where["id in({$str_ids})"] = null;
} else {
$where["id not in({$str_ids})"] = null;
}
}
//是否开票
if ($params['isbill'] == 1) {
$where["bill_time <>"] = '0000-00-00 00:00:00';
}
if ($params['isbill'] == 2) {
$where["bill_time"] = '0000-00-00 00:00:00';
}
//交付时间
if ($params['ck_time']) {
$ck_time = explode(' ~ ', $params['ck_time']);
@@ -125,6 +151,10 @@ class OrdersList
$params['brand_id'] && $where['brand_id'] = $params['brand_id'];
$params['series_id'] && $where['series_id'] = $params['series_id'];
$params['car_id'] && $where['car_id'] = $params['car_id'];
!strlen($params['cps_type']) && $params['cps_type'] = '';
if (strlen($params['cps_type'])) {
$where['cps_type'] = intval($params['cps_type']);
}
//销售员筛选
if ($params['admin_id']) {
$where["sale_id"] = $params['admin_id'];
@@ -162,15 +192,19 @@ class OrdersList
if (strlen($params['status'])) {
$where['status'] = $params['status'];
}
if ($params['admin_biz_str']) {
$where["biz_id in ({$params['admin_biz_str']})"] = null;
}
$orderby = "c_time desc";
$count = $this->ci->mdOrders->count($where);
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size);
$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));
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id,p_time', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
@@ -211,6 +245,7 @@ class OrdersList
$car_name = isset($cars[$val['car_id']]) ? $cars[$val['car_id']][0]['name'] : '';
$money_json = json_decode($val['money_json'], true);
$fields['o_id'] = $val['id'];
$fields['sid'] = $val['sid'];
$name = $val['name'];
$mobile = $val['mobile'];
$open_url = '/receiver/orders/get?id=';
@@ -230,6 +265,7 @@ class OrdersList
$fields['status_name'] = $status_name;
$fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] . '<br>' . $admins[$val['admin_id']] : '';
$size > 1000 && $fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] : '';
$fields['p_time'] = date('Y-m-d H:i:s', strtotime($customers[$val['customer_id']]['p_time']));
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$of_title = '-';
$of_title_1 = $of_title_2 = '';
@@ -242,6 +278,7 @@ class OrdersList
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
$of2_id && $of_ary['list'][$of2_id] && $of_title_2 = $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['of_title_1'] = $of_title_1;
$fields['of_title_2'] = $of_title_2;
@@ -251,12 +288,39 @@ class OrdersList
$fields['refund_time'] = $val['refund_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($val['refund_time'])) : '';
$fields['ck_time'] = $val['ck_time'];
$odata = $this->ci->receiver_order_datas_model->get(['o_id' => $val['id']]);
$fields['contract'] = $odata['contract_img'] ? '有' : '无';
if($odata['jsondata']){
$bill_data = json_decode($odata['jsondata'], true);
if(is_array($bill_data['bill_info'])){
foreach ($bill_data['bill_info'] as $k => $v){
if($v['Name'] == '销货单位名称'){
$fields['bill_name'] = $v['Value'];
}
if($v['Name'] == '价税合计(小写)'){
$fields['bill_price'] = $v['Value'];
}
}
}
}
if ($size > 1000) {
$user_info = '';
if (!$user_info) {
$sale = $this->ci->mdLichebUsers->get(['id' => $val['sale_id']], 'uname');
$fields['admin_name'] = $sale['uname'];
}
$fields['cps_type_name'] = Receiver_orders_model::CPS_TYPES[$val['cps_type']];
} else {
if ($val['cps_type'] == Receiver_orders_model::CPS_TYPE_NORMAl) {
$cps_class = 'btn-success';
} elseif ($val['cps_type'] == Receiver_orders_model::CPS_TYPE_IMPORTANT) {
$cps_class = 'btn-danger';
} else {
$cps_class = 'btn-warning';
}
$fields['car_name'] .= "<br><span class='btn btn-xs {$cps_class}'>" . Receiver_orders_model::CPS_TYPES[$val['cps_type']] . "</span>";
}
$lists[] = $fields;
}
@@ -280,6 +344,7 @@ class OrdersList
{
$fields1 = $fields2 = [];
if ($export) {
$fields1['sid'] = ['title' => '订单号'];
$fields1['name'] = ['title' => '客户姓名'];
$fields1['mobile'] = ['title' => '客户电话'];
$fields1['id_card'] = ['title' => '证件号码'];
@@ -304,9 +369,14 @@ class OrdersList
$fields = array_merge($fields1, $fields2);
if ($export) {
unset($fields['price'], $fields['c_time'], $fields['car_name'], $fields['of_title']);
!$fields['p_time'] && $fields['p_time'] = ['title' => '建档时间'];
!$fields['c_time'] && $fields['c_time'] = ['title' => '订单时间'];
!$fields['order_time'] && $fields['order_time'] = ['title' => '下定时间'];
!$fields['bill_time'] && $fields['bill_time'] = ['title' => '开票时间'];
!$fields['contract'] && $fields['contract'] = ['title' => '购车合同'];
$fields['cps_type_name'] = ['title' => 'CPS品牌'];
$fields['bill_name'] = ['title' => '开票方'];
$fields['bill_price'] = ['title' => '开票价'];
}
return $fields;
}
-2
View File
@@ -42,7 +42,6 @@
<label><input type="checkbox" data-check-target=".ids"></label>
<span>ID</span>
</th>
<th width="10%"><span>车型id</span></th>
<th width="10%"><span>品牌</span></th>
<th width="10%"><span>车系</span></th>
<th width="20%"><span>车型</span></th>
@@ -57,7 +56,6 @@
<label><input type="checkbox" name="ids[]" class="ids" :value="v.id"/></label>
<span>{{v.id}}</span>
</td>
<td>{{v.third_car_id}}</td>
<td>{{v.brand}}</td>
<td>{{v.series}}</td>
<td>{{v.name}}</td>
+480
View File
@@ -0,0 +1,480 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
</div>
<div class="coms-table-wrap mt10">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/autohome/customer" id="search_form">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<input name="mobile" type="text" placeholder="输入手机号查询" 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="push_id">
<option value=''>请选择</option>
<option value='0' <?php if($params['push_id'] == '0'){?> selected="selected" <?php }?> >未上传</option>
<option value='1' <?php if($params['push_id'] == '1'){?> selected="selected" <?php }?> >上传成功</option>
<option value='-1' <?php if($params['push_id'] == '-1'){?> selected="selected" <?php }?> >上传失败</option>
</select>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">线索来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<option :value="i" v-for="(v,i) in cfromAry">{{v}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<option :value="i" v-for="(v,i) in cfromAry2">{{v}}</option>
</select>
</div>
<label class="am-para-label w100">线索渠道:</label>
<div class="am-form-group am-para-inline w150">
<select name="channel" v-model="channel">
<option value=0>请选择</option>
<option :value="i" v-for="(v,i) in channelAry">{{v}}</option>
</select>
</div>
</div>
<div class="fl">
<label class="am-para-label w100">所属地区:</label>
<div class="am-form-group am-para-inline w150">
<select name="province_id" v-model="province_id">
<option value="0">省份</option>
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="city_id" v-model="city_id">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<label class="am-para-label w100">品牌车型:</label>
<div class="am-para-inline w120">
<select name="brand_id" v-model="brand_id">
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="series_id" v-model="series_id">
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">创建时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_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="today" data-btn="create"
data-source="id-create-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="create"
data-source="id-create-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="create"
data-source="id-create-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="create"
data-source="id-create-time">本月</a>
</div>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">上传时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-push-time" name="p_time" type="text" value="<?= $params['p_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="today" data-btn="push"
data-source="id-push-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="push"
data-source="id-push-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="push"
data-source="id-push-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="push"
data-source="id-push-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml30">
<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="import" 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" class="am-btn am-btn-success am-btn-sm w100" @click="export_out"
title="最多500条" v-if="export_button">导出
</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w150" @click="push_search">按搜索结果上传</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="15%"><span>客户</span></th>
<th width="15%"><span>所属地区</span></th>
<th width="15%"><span>品牌车型</span></th>
<th width="15%"><span>线索来源</span></th>
<th width="15%"><span>线索渠道</span></th>
<th width="10%"><span>上传状态</span></th>
<th width="15%"><span>上传时间</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td style="vertical-align: middle;"><a
data-open="/receiver/clues/get?id=<?= $v['id'] ?>&type=clues"
href="javascript:void(0);"><?= $v['name'] ?><br><?= $v['mobile'] ?></a></td>
<td style="vertical-align: middle;"><?= $v['area_title'] ?></td>
<td style="vertical-align: middle;"><?= $v['car_title'] ?></td>
<td style="vertical-align: middle;"><?= $v['cf_title'] ?></td>
<td style="vertical-align: middle;"><?= $v['channel'] ?></td>
<td style="vertical-align: middle;"><?= $v['push_status'] ?></td>
<td style="vertical-align: middle;"><?=$v['c_time']?></td>
</tr>
<? }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<? page_view($pager) ?>
</div>
</div>
<div id="cule-modal" style="display: none;padding: 10px">
<div class="modal-body">
<div class="text-center">
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
<div class="form-group-action">
<a href="/temp/clues.xlsx" target="_blank" class="btn btn-default">查看模板</a>
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
<form id="import-form">
<input type="file" id="clue-file" name="file" accept=".xls,.xlsx"
style="left:-9999px;position:absolute;" onchange="load_clue()">
</form>
<span>上传Excel文件</span>
</label>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
vue_obj = new Vue({
el: '#search_form',
data: {
province_id: <?=$params['province_id'] ? $params['province_id'] : 0?>,
city_id: <?=$params['city_id'] ? $params['city_id'] : 0?>,
cfrom_id: <?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2: <?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
brand_id: <?=$params['brand_id'] ? $params['brand_id'] : 0?>,
series_id: <?=$params['series_id'] ? $params['series_id'] : 0?>,
channel: <?=$params['channel'] ? $params['channel'] : 0?>,
cfromAry: [],
cfromAry2: [],
channelAry: [],
provinceAry: [],
cityAry: [],
brandAry: [],
seryAry: [],
export_button: 1
},
mounted: function () {
this.init_provinces();
this.init_citys();
this.cfromAry = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
this.channelAry = <?=json_encode($channelAry, JSON_UNESCAPED_UNICODE)?>;
this.init_brands();
this.get_series();
this.init_cfrom2();
},
methods: {
init_brands: function () {
var vm = this;
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
vm.brandAry = response.data;
})
},
get_series: function () {
var vm = this;
vm.seryAry = {};
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.brand_id}, function (response) {
vm.seryAry = response.data;
})
},
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
if (response.code == 1) {
vm.provinceAry = response.data;
}
});
},
init_citys: function () {
var vm = this;
$.get('common/area', {id: vm.province_id, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
},
init_cfrom2: function () {
var vm = this;
$.post('autohome/customer/json_map_cfrom', {pid: vm.cfrom_id}, function (response) {
if (response.code == 1) {
vm.cfromAry2 = response.data;
}
});
},
reset: function () {
var that = this;
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
$('#id-push-time').val('');
that.province_id = 0;
that.city_id = 0;
that.cfrom_id = 0;
that.cfrom2_id = 0;
that.brand_id = 0;
that.series_id = 0;
that.channel = 0;
},
export_out: function () {
var that = this;
if (that.export_button == 0) {
layer.msg('无权限导出');
return false;
}
let count = <?=$pager['totle']?>;
if (count == 0) {
layer.msg('没有数据可导出');
return false;
}
let href = $.menu.parseUri(window.location.href);
href = href.replace("customer?", "customer/export?");
window.location.href = href;
},
push_search: function (){
let queryString = window.location.hash.split("?")[1];
params = queryString.substring(1).split('&');
paramsObj = {};
params.forEach(param => {
[key, value] = param.split('=');
paramsObj[key] = decodeURIComponent(value);
});
$.get('autohome/customer/push_search', paramsObj, function (response) {
if (response.code == 1) {
layer.msg('上传成功:'+ response.data.succ+' '+'上传失败:' + response.data.fail+' '+'未处理:' + response.data.undo);
window.location.reload();
}
});
}
},
watch: {
'brand_id': function (nv, ov) {
if (nv !== '') {
this.get_series()
}
},
'province_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cityAry = [];
that.city_id = '0';
} else {
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
that.cityAry = response.data;
if (that.city_id > 0) {
var city_id = '0';
for (var i in that.cityAry) {
var city = that.cityAry[i];
if (city.id == that.city_id) {
city_id = city.id;
break;
}
}
that.city_id = city_id;
}
}
});
}
},
'city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.county_id = '0';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.county_id > 0) {
var county_id = '0';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.county_id) {
county_id = county.id;
break;
}
}
that.county_id = county_id;
}
}
});
}
},
'cfrom_id': function (nv, ov) {
var that = this;
that.cfrom_id2 = 0;
if (nv == '') {
that.cfromAry2 = [];
} else {
$.post('/autohome/customer/json_map_cfrom', {pid: nv}, function (result) {
that.cfromAry2 = result.data;
if (that.cfrom_id2 > 0) {
var of2_id = '';
for (var i in that.show_info.cfromAry2) {
if (i == that.cfrom_id2) {
of2_id = i;
break;
}
}
that.cfrom_id2 = of2_id;
}
});
}
}
}
});
$("#import").click(function () {
$("#clue-file").val('');
layer.open({
type: 1,
area: ['40%'], //宽高
content: $('#cule-modal'),
title: '导入线索',
shade: false,
btn: ['完成'],
yes: function (index) {
layer.close(index);
}
});
});
});
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
laydate.render({
elem: '#id-push-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-create-time';
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
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);
switch ($(this).data('btn')) {
case 'create':
$('#id-create-time').val(date);
break;
case 'push':
$('#id-push-time').val(date);
break;
}
});
});
function load_clue() {
var file = $("#clue-file");
if (file.val() == '') {
layer.msg('文件是空的');
return 0;
}
var loading = layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
var options = {
url: "/autohome/customer/add_excel",
type: "post",
dataType: "json",
data: {},
success: function (res) {
if (1 == res.code) {
layer.msg(res.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
}
},
complete: function () {
file.val('');
layer.close(loading);
}
};
$("#import-form").ajaxSubmit(options);
}
</script>
+18
View File
@@ -0,0 +1,18 @@
<form class="am-form am-form-horizontal" action="/biz/store/store/add_money" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto">
<div class="am-form-group">
<label class="am-para-label"><span class="com-must-star">*</span>门店:</label>
<div class="am-para-input">
<span style="line-height: 37px"><?=$biz['biz_name'];?></span>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">充值金额:</label>
<div class="am-para-input">
<input type="number" placeholder="请输入金额" name="money" value=""/>
</div>
</div>
<input type="hidden" name="id" value="<?=$biz['id']?>">
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="submit">提交</button></div>
</div>
</form>
+93 -14
View File
@@ -135,14 +135,15 @@
<div class="am-form-group">
<label class="am-para-label">门店:</label>
<div class="am-para-input"><input type="text" placeholder="(最多 30 个字符)" name="biz_name"
value="<?= $biz['biz_name'] ?>"/></div>
v-model="info.biz_name"/></div>
</div>
<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">
<select name="province_id" style="width: 200px;" data-toggle="next-select"
<select name="province_id" v-model="info.province_id" style="width: 200px;"
data-toggle="next-select"
data-refurl="/common/area?key=city&id={value}&url=edit" data-next="#bd-hd-city">
<option value="0">省份</option>
<?php if ($provinces) {
@@ -154,7 +155,8 @@
</select>
</div>
<div class="am-form-group">
<select id="bd-hd-city" name="city_id" style="width: 200px;" data-toggle="next-select"
<select id="bd-hd-city" name="city_id" v-model="info.city_id" style="width: 200px;"
data-toggle="next-select"
data-refurl="/common/area?key=county&id={value}" data-next="#bd-hd-county">
<option value="0">城市</option>
<?php if ($citys) {
@@ -168,7 +170,7 @@
<div class="am-form-group">
<!--<select id="bd-hd-county" name="county_id" style="width: 200px;" data-toggle="next-select"-->
<!-- data-refurl="/common/area?key=street&id={value}" data-next="#bd-hd-street">-->
<select id="bd-hd-county" name="county_id" style="width: 200px;">
<select id="bd-hd-county" name="county_id" v-model="info.county_id" style="width: 200px;">
<option value="0">行政区</option>
<?php if ($countys) {
foreach ($countys as $value) { ?>
@@ -179,7 +181,7 @@
</select>
</div>
<div class="am-form-group" style="display: none">
<select id="bd-hd-street" name="street_id" style="width: 200px;">
<select id="bd-hd-street" name="street_id" v-model="info.street_id" style="width: 200px;">
<option value="0">街道/乡镇</option>
<?php if ($street) {
foreach ($street as $value) { ?>
@@ -190,7 +192,7 @@
</select>
</div>
<div class="am-form-group" style="display: none">
<select name="area_id" style="width: 200px;" id="bd-hd-area">
<select name="area_id" style="width: 200px;" v-model="info.area_id" id="bd-hd-area">
<option value="0">商圈</option>
<?php if ($areas) {
foreach ($areas as $value) { ?>
@@ -206,7 +208,8 @@
<div class="am-form-group">
<div class="am-para-input">
<div class="am-input-group am-input-group-primary">
<input type="text" placeholder="详细地址" id="address" name="address" value="<?= $biz['address'] ?>"/>
<input type="text" placeholder="详细地址" id="address" name="address"
v-model="info.address"/>
<span class="am-input-group-btn">
<button id="addr-btn" class="am-btn am-btn-primary" type="button"><span
class="am-icon-search"></span></button>
@@ -219,12 +222,14 @@
<div class="am-form-inline">
<div class="am-input-group">
<span class="am-input-group-label">经度</span>
<input type="text" class="am-form-field" placeholder="经度" name="lng" value="<?= $biz['lng'] ?>"
<input type="text" class="am-form-field" placeholder="经度" name="lng"
value="<?= $biz['lng'] ?>"
id="biz-edit-lng">
</div>
<div class="am-input-group">
<span class="am-input-group-label">纬度</span>
<input type="text" class="am-form-field" placeholder="纬度" name="lat" value="<?= $biz['lat'] ?>"
<input type="text" class="am-form-field" placeholder="纬度" name="lat"
value="<?= $biz['lat'] ?>"
id="biz-edit-lat">
</div>
</div>
@@ -248,15 +253,47 @@
<input type="hidden" name="headimg"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $biz['headimg'] ?>" class="layui-input">
value="<?= $biz['headimg'] ?>" class="layui-input" id="biz_headimg">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $biz['avatar'] ?>"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">类型:</label>
<div class="am-para-input wp20">
<select name="type" v-model="info.type">
<option value="0">选择类型</option>
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<template v-if="info.type==5">
<div class="am-form-group">
<label class="am-para-label">车型品牌:</label>
<div class="am-para-input wp40">
<el-select name="car_brand_ids" style="width: 100%" v-model="info.car_brand_ids"
placeholder="请选择" filterable clearable multiple sear>
<el-option
v-for="(v,i) in auto_brands"
:key="v.id"
:label="v.name"
:value="v.id">
</el-option>
</el-select>
<!--
<select name="car_brand_id" v-model="info.car_brand_id">
<option v-for="(v,i) in auto_brands" :value="v.id">
{{v.name}}
</option>
</select>
-->
</div>
</div>
</template>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<button class="am-btn am-btn-success" type="submit">提交</button>
<button class="am-btn am-btn-success" type="button" @click="submit">提交</button>
</div>
</div>
</form>
@@ -352,16 +389,58 @@
el: '#vue-app',
data: {
cate_id: <?=$biz['cate_id'] ? $biz['cate_id'] : "''"?>,
info:<?=json_encode($biz)?>,
info: <?=json_encode($biz)?>,
typeAry: <?=json_encode($typeAry)?>,
auto_brands: []
},
mounted: function () {
this.init_auto_brands();
},
methods: {
init_auto_brands: function () {
var vm = this;
$.ajax({
url: '/common/brands',
type: 'post',
dataType: 'json',
data: {status: 1, size: 1000},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
vm.auto_brands = data.data.itemsList;
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
},
submit() {
let vm = this;
let url = '/biz/store/store/edit';
if (!this.info.id) {
url = '/biz/store/store/add'
}
vm.info.headimg = $('#biz_headimg').val();
vm.info.lng = $("#biz-edit-lng").val();
vm.info.lat = $("#biz-edit-lat").val();
console.log(vm.info)
$.post(url, vm.info, function (result) {
if (result.code) {
layer.msg(result.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
});
} else {
layer.msg(result.msg, {icon: 2});
}
}, 'json')
}
},
created: function () {
},
watch: {
}
watch: {}
});
/**
+79 -41
View File
@@ -39,7 +39,28 @@
</select>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-form-group am-para-inline w150">
<select name="type" v-model="type">
<option value="0">所有</option>
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl" :style="'visibility: '+ [type==5? '' : 'hidden']">
<label class="am-para-label w100">品牌:</label>
<div class="am-form-group am-para-inline w150">
<select class="selectpicker" name="brand_id" v-model="brand_id" data-live-search="true">
<option value="0">所有品牌</option>
<? foreach ($brandAry as $v) { ?>
<option value="<?= $v['id'] ?>"><?= $v['name'] ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<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">
@@ -55,14 +76,20 @@
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<div class="am-form-group">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
<button type="button" data-open="/biz/store/store/get" class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
<!--
<div class="am-form-group fl ml20">
<button type="button" data-open="/biz/store/store/get" class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
-->
</div>
</form>
<div class="coms-table-bd">
@@ -73,6 +100,9 @@
<th width="50"></th>
<th width="5%"><span>ID</span></th>
<th><span>门店</span></th>
<th width="10%"><span>品牌</span></th>
<td width="10%">余额</td>
<th width="10%"><span>门店类型</span></th>
<th width="15%"><span>创建时间</span></th>
<th width="20%"><span>操作</span></th>
</tr>
@@ -85,8 +115,13 @@
</td>
<td><?= $v['id'] ?></td>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['brand_name'] ?></td>
<td><?= $v['money_left'] ?></td>
<td><?= $v['biz_type'] ?></td>
<td><?= $v['c_time'] ?></td>
<td>
<a data-modal="/biz/store/store/add_money?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">充值</a>
<a data-open="/biz/store/store/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
<input type="hidden" class="biz-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".biz-id-<?= $v['id'] ?>"
@@ -176,19 +211,52 @@
</div>
</div>
<script>
require(['laydate', 'autocomplete', 'bootstrap-select'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
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;
$('#id-create-time').val(date);
});
$('.selectpicker').selectpicker();
});
var vm = new Vue({
el: '#vue-app',
data: {
province_id:<?=$params['province_id'] ? $params['province_id'] : 0?>,
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
brand_id: <?=$params['brand_id'] ? $params['brand_id'] : 0?>,
province_id: <?=$params['province_id'] ? $params['province_id'] : 0?>,
city_id: <?=$params['city_id'] ? $params['city_id'] : 0?>,
county_id: <?=$params['county_id'] ? $params['county_id'] : 0?>,
type: <?=$params['type'] ? $params['type'] : 0?>,
qdjl_lists: [],
channel_uid: [],
biz_manage: {admins: [], group_id: 2, admin_id: 0, biz_id: 0, admin_name: ''},
typeAry:<?=$typeAry ? json_encode($typeAry) : '[]'?>,
typeAry: <?=$typeAry ? json_encode($typeAry) : '[]'?>,
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
cityAry: [],
countyAry: []
countyAry: [],
},
mounted: function () {
this.qdjl_lists = <?=json_encode($qdjl_lists)?>;
@@ -196,7 +264,7 @@
this.init_countys();
},
methods: {
channel_modal: function (biz_id,biz_name) {
channel_modal: function (biz_id, biz_name) {
//选择渠道归属
var vm = this;
vm.channels = [];
@@ -215,7 +283,7 @@
type: 1,
area: ['50%', '40%'], //宽高
content: $('#channel-modal'),
title: biz_name+'-渠道归属',
title: biz_name + '-渠道归属',
shade: false,
btn: ['保存选择'],
yes: function (index) {
@@ -236,7 +304,7 @@
}
});
},
biz_manage_modal: function (biz_id,biz_name) {
biz_manage_modal: function (biz_id, biz_name) {
//选择门店管理员
var vm = this;
vm.biz_manage = {admins: [], group_id: 2, admin_id: 0, biz_id: biz_id, admin_name: ''};
@@ -245,7 +313,7 @@
type: 1,
area: ['50%', '50%'], //宽高
content: $('#biz_manage-modal'),
title: biz_name+'-门店管理员',
title: biz_name + '-门店管理员',
shade: false,
btn: ['保存选择'],
yes: function (index) {
@@ -360,36 +428,6 @@
}
}
});
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
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;
$('#id-create-time').val(date);
});
});
$(function () {
<?php page_script($pager) ?>
});
+330 -86
View File
@@ -20,6 +20,9 @@
<link rel="stylesheet" type="text/css" href="/static/css/switch.css">
<link rel="stylesheet" type="text/css" href="/static/js/plugin/viewer/viewer.css?t=3">
<link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
<script type="text/javascript" src="/static/js/plugin/bootstrap-select/popper.min.js"></script>
<script type="text/javascript" src="/static/js/common/jquery-3.0.0.js"></script>
<script type="text/javascript" src="/static/js/common/vue.min.js"></script>
<script type="text/javascript" src="/AmazeUI/assets/js/amazeui.js"></script>
@@ -34,10 +37,13 @@
<script type="text/javascript" src="/static/js/common/vuedraggable.umd.min.js?t=2020221"></script>
<script type="text/javascript" src="/static/js/common/jquery.form.js?t=2020410"></script>
<script type="text/javascript" src="/static/js/plugin/viewer/viewer.js?t=4"></script>
<link rel="stylesheet" href="/static/js/plugin/element-ui/index.css">
<script src="/static/js/plugin/element-ui/index.js"></script>
<script>window.ROOT_URL = '';</script>
</head>
<body>
<div class="coms-layout-container theme-default">
<div class="coms-layout-container theme-default" id="index-vue-app">
<div class="coms-layout-header">
<div class="bars-nav"><i class="am-icon-bars"></i>导航</div>
<a href="" class="logo" style="">
@@ -47,77 +53,111 @@
<ul class="header-nav">
<? foreach ($menus as $v) { ?>
<?php if (!$v['sub']) { ?>
<li data-menu-node='m-<?=$v['id']?>' data-open="<?=$v['url']?>"><a href="javascript:void (0);"><?=$v['name']?></a></li>
<li data-menu-node='m-<?= $v['id'] ?>' data-open="<?= $v['url'] ?>"><a
href="javascript:void (0);"><?= $v['name'] ?></a></li>
<?php } else { ?>
<li data-menu-node='m-<?=$v['id']?>'><a href="javascript:void (0);"><?=$v['name']?></a>
<li data-menu-node='m-<?= $v['id'] ?>'><a href="javascript:void (0);"><?= $v['name'] ?></a>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<div class="header-userinfo">
<a class="info-name" href="javascript:;"><?=$_username?><span class="arrow"></span></a>
<a class="info-name" href="javascript:;"><?= $_username ?><span class="arrow"></span></a>
<ul class="dropdown-list">
<li><a href="javascript:void (0);" data-open="/expfile" data-title="导出文件">导出文件</a></li>
<li><a href="javascript:void (0);" data-modal="/login/reset_pwd" data-title="修改秘密">修改密码</a></li>
<li><a href="javascript:void (0);" data-load="/login/logout" data-confirm="确定要退出登录吗?">退出</a></li>
<li><a href="javascript:void (0);" data-load="/login/logout" data-confirm="确定要退出登录吗?">退出</a>
</li>
</ul>
</div>
<!--div class="header-notice">
<a class="tit" href="javascript:;">通知<b><i>0</i></b></a>
<ul class="dropdown-list">
<li><a href="#">新的订单</a></li>
<div class="header-notice">
<a class="tit" href="javascript:;">通知<b><i>{{ countNotice }}</i></b></a>
<ul class="dropdown-list" style="width: 180px">
<template v-if="notice.length > 0">
<li v-for="(item,index) in notice">
<a @click="setRead(item,index)" href="#"
style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
{{ item.content}}
</a>
</li>
<!-- 按钮容器:使用Flex实现左右分栏 -->
<li style="display: flex; border-top: 1px solid #eee; margin-top: 4px;">
<a href="javascript:void(0);"
style="color: #ff4d4f; flex: 1; text-align: center; padding: 4px 0; text-decoration: none;"
@click="clearNotice">
<i class="fa"></i> 清除所有
</a>
<a data-open="/sys/notice" href="javascript:void(0);"
style="flex: 1; text-align: center; padding: 4px 0; text-decoration: none; color: inherit;">
<i class="fa"></i> 查看更多
</a>
</li>
<!--
<a href="javascript:void(0);" style="color: #ff4d4f; border-top: 1px solid #eee;">
<i class="fa"></i> 清除所有
</a>
<a href="javascript:void(0);">
<i class="fa"></i> 查看更多
</a>
-->
</template>
<li v-if="notice.length === 0">
<a href="javascript:void(0);" style="color: #999; cursor: default;">暂无通知</a>
</li>
</ul>
</div-->
</div>
</div>
<div class="coms-layout-aside fold" id="J_coms-layout-aside" style="display: none">
<div class="aside-menu-scroll">
<?php if($menus){ ?>
<div class="aside-unfold"><i class="iconfont f18">&#xe6d4;</i></div>
<?php foreach ($menus as $pmenu) { ?>
<?php if ($pmenu['sub']) { ?>
<ul class="aside-menu" data-menu-box="m-<?=$pmenu['id']?>">
<?php foreach ($pmenu['sub'] as $menu) { ?>
<?php if (!$menu['sub']) { ?>
<li class="treeview" data-menu-node='m-<?=$pmenu['id']?>-<?=$menu['id']?>' data-open="<?=$menu['url']?>">
<a style="text-align: center" href="javascript:void(0)"><i class="iconfont f14">&#xe65d;</i><span class="txt"><?=$menu['name']?></span></a>
</li>
<?php } else { ?>
<li class="treeview">
<a href="javascript:void(0)" style="text-align: center">
<?php if ($menus) { ?>
<div class="aside-unfold"><i class="iconfont f18">&#xe6d4;</i></div>
<?php foreach ($menus as $pmenu) { ?>
<?php if ($pmenu['sub']) { ?>
<ul class="aside-menu" data-menu-box="m-<?= $pmenu['id'] ?>">
<?php foreach ($pmenu['sub'] as $menu) { ?>
<?php if (!$menu['sub']) { ?>
<li class="treeview" data-menu-node='m-<?= $pmenu['id'] ?>-<?= $menu['id'] ?>'
data-open="<?= $menu['url'] ?>">
<a style="text-align: center" href="javascript:void(0)"><i class="iconfont f14">&#xe65d;</i><span
class="txt"><?= $menu['name'] ?></span></a>
</li>
<?php } else { ?>
<li class="treeview">
<a href="javascript:void(0)" style="text-align: center">
<?php if($menu['icon']){?>
<i class="<?=$menu['icon']?> "></i>
<?php }else{ ?>
<i class="iconfont f14">&#xe65d;</i>
<?php } ?>
<span class="txt"><?=$menu['name']?></span>
</a>
<ul class="list" style="display: none" data-menu-box='m-<?=$pmenu['id']?>-<?=$menu['id']?>'>
<?php foreach ($menu['sub'] as $submenu) {
$url = $submenu['url'];
$node = "{$pmenu['id']}-{$menu['id']}-{$submenu['id']}";
if((!$url || $url == '#') && $submenu['sub']) {
$url = $submenu['sub'][0]['url'];
$node .= "-{$submenu['sub'][0]['id']}";
}
?>
<li data-menu-node='m-<?=$node?>' data-open="<?=$url?>">
<a href="javascript:void (0);"><?=$submenu['name']?></a>
</li>
<?php } ?>
</ul>
</li>
<?php if ($menu['icon']) { ?>
<i class="<?= $menu['icon'] ?> "></i>
<?php } else { ?>
<i class="iconfont f14">&#xe65d;</i>
<?php } ?>
<span class="txt"><?= $menu['name'] ?></span>
</a>
<ul class="list" style="display: none"
data-menu-box='m-<?= $pmenu['id'] ?>-<?= $menu['id'] ?>'>
<?php foreach ($menu['sub'] as $submenu) {
$url = $submenu['url'];
$node = "{$pmenu['id']}-{$menu['id']}-{$submenu['id']}";
if ((!$url || $url == '#') && $submenu['sub']) {
$url = $submenu['sub'][0]['url'];
$node .= "-{$submenu['sub'][0]['id']}";
}
?>
<li data-menu-node='m-<?= $node ?>' data-open="<?= $url ?>">
<a href="javascript:void (0);"><?= $submenu['name'] ?></a>
</li>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php } ?>
<?php } ?>
</ul>
</ul>
<?php } ?>
<?php } ?>
<div class="aside-menu-sub">
</div>
<?php } ?>
<div class="aside-menu-sub">
</div>
<?php }?>
</div>
</div>
@@ -125,75 +165,141 @@
<div class="coms-layout-body-inner">
<article class="am-article" style="display: none">
<div class="am-article-hd">
<h1 class="am-article-title">欢迎 [<?=$_role?>] <?=$_username?></h1>
<h1 class="am-article-title">欢迎 [<?= $_role ?>] <?= $_username ?></h1>
<p class="am-article-meta">
<?php
$no = date("H", time());
$week = array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日");
if ($no > 0 && $no <= 6){
echo "凌晨好!";
}elseif ($no > 6 && $no < 12){
echo "上午好!";
}elseif ($no >= 12 && $no <= 18){
echo "下午好!";
}else{
echo "晚上好!";
}
?>
<?php
$no = date("H", time());
$week = array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日");
if ($no > 0 && $no <= 6) {
echo "凌晨好!";
} elseif ($no > 6 && $no < 12) {
echo "上午好!";
} elseif ($no >= 12 && $no <= 18) {
echo "下午好!";
} else {
echo "晚上好!";
}
?>
</p>
</div>
<div class="am-article-bd">
<p class="am-article-lead">现在时间是:<?=date('Y年m月d日')?> <?=$week[date('w')]?> <?=date('H:i:s')?> 当前IP<?=get_client_ip()?></p>
<p class="am-article-lead">
现在时间是:<?= date('Y年m月d日') ?> <?= $week[date('w')] ?> <?= date('H:i:s') ?>
当前IP<?= get_client_ip() ?></p>
</div>
</article>
</div>
</div>
<audio id="notification-sound" hidden>
<source src="/static/audio/message-ding.mp3" type="audio/mpeg">
</audio>
</div>
</body>
<script type="text/javascript" src="/static/js/plugin/require/require.js"></script>
<script type="text/javascript" src="/static/js/common/app.js"></script>
<script type="text/javascript" src="/static/js/common/app.js?v=1"></script>
<script type="text/javascript">
//查看图片控件
function showViewer(obj){
function showViewer(obj) {
new Viewer(document.getElementById(obj));
}
var _index_vue_obj;
var log_data = {};
var heartbeatInterval = null;
var pongTimeout = null;
const $audio = $('#notification-sound');
let isAudioLoaded = false; // 标记音频是否预加载完成
(function ($) {
$(".coms-layout-header .bars-nav").on("click",function(event){
_index_vue_obj = new Vue({
el: '#index-vue-app',
data: {
countNotice: <?=$_noticeCount?>,
notice: <?=json_encode($_notice)?>
},
mounted: function () {
},
methods: {
clearNotice() {
let that = this;
$.post('/common/set_notice', {}, function (data) {
if (data.code) {
layer.msg(data.msg, {icon: 1});
that.countNotice = 0;
that.notice = [];
} else {
layer.msg(data.msg, {icon: 2});
}
})
},
setRead(item, index) {
let that = this;
$.post('/common/set_notice', {id: item.id}, function (data) {
if (data.code) {
that.notice.splice(index, 1);
that.countNotice--;
let btn = ['关闭'];
if (item.url) {
btn = ['查看详情', '关闭'];
}
layer.confirm(item.content, {
btn: btn,
title: '通知详情'
}, function (index) {
// 点击查看详情
if (item.url) {
$.form.href(item.url);
}
layer.close(index);
}, function (index) {
// 点击关闭
layer.close(index);
});
} else {
layer.msg(data.msg, {icon: 2});
}
})
}
}
});
// 初始化 WebSocket 连接
initWebSocket();
$(".coms-layout-header .bars-nav").on("click", function (event) {
event.stopPropagation()
var $headNav=$(".header-nav");
if($headNav.hasClass("active")){
var $headNav = $(".header-nav");
if ($headNav.hasClass("active")) {
$headNav.removeClass("active")
}else{
} else {
$headNav.addClass("active")
}
});
$("body").on("touchstart",function(event){
if($(event.target).closest(".header-nav").length){
$("body").on("touchstart", function (event) {
if ($(event.target).closest(".header-nav").length) {
return;
}else{
} else {
$(".header-nav").removeClass("active");
}
})
$(function(){
var $aside=$("#J_coms-layout-aside"),
$fold=$aside.find(".aside-unfold"),
$mainBody=$("#J_coms-layout-body");
$fold.on("click",function(){
$(function () {
var $aside = $("#J_coms-layout-aside"),
$fold = $aside.find(".aside-unfold"),
$mainBody = $("#J_coms-layout-body");
$fold.on("click", function () {
if($aside.hasClass('fold')){
if ($aside.hasClass('fold')) {
$aside.removeClass('fold');
$mainBody.removeClass('unfold');
$('.coms-layout-body').css('left',220);
$(".coms-body-main-nav").css("left",220)
}else{
$('.coms-layout-body').css('left', 220);
$(".coms-body-main-nav").css("left", 220)
} else {
$aside.addClass('fold');
$mainBody.addClass('unfold');
$('.coms-layout-body').css('left',65);
$(".coms-body-main-nav").css("left",65);
$('.coms-layout-body').css('left', 65);
$(".coms-body-main-nav").css("left", 65);
}
});
@@ -207,8 +313,146 @@
color: '#000',
alpha: 0.03,
});
// 1. 监听音频预加载完成事件
$audio.on('canplaythrough', function () {
isAudioLoaded = true;
console.log('音频预加载完成,等待通知触发播放');
});
})
})(jQuery)
function initWebSocket() {
// 构建 WebSocket 连接 URL
var wsUrl = "<?=$wss_url?>";
try {
// 创建 WebSocket 实例
var websocket = new WebSocket(wsUrl);
// 连接打开事件
websocket.onopen = function (event) {
console.log('websocket 连接成功');
// 在websocket.onopen回调中添加:
heartbeatInterval = setInterval(function () {
if (window.adminWebsocket && window.adminWebsocket.readyState === WebSocket.OPEN) {
window.adminWebsocket.send(JSON.stringify({type: 'heartbeat', content: 'ping'}));
// 设置等待pong响应的超时
pongTimeout = setTimeout(function () {
console.warn('Heartbeat timeout - closing connection');
window.adminWebsocket.close();
}, 5000); // 5秒内等待pong响应
}
}, 30000); // 每30秒发送一次ping
};
// 接收消息事件
websocket.onmessage = function (event) {
try {
console.log('websocket 接收到消息:', event.data);
var data = JSON.parse(event.data);
handleWebSocketMessage(data);
} catch (e) {
console.error('websocket 解析消息错误:', e);
}
};
// 错误处理事件
websocket.onerror = function (error) {
console.error('websocket 错误信息:', error);
};
// 连接关闭事件
websocket.onclose = function (event) {
console.log('websocket 关闭连接', event);
if (heartbeatInterval) {
clearInterval(heartbeatInterval);
heartbeatInterval = null;
}
if (pongTimeout) {
clearTimeout(pongTimeout);
pongTimeout = null;
}
// 5秒后尝试重连
setTimeout(initWebSocket, 5000);
};
// 保存 WebSocket 实例供全局使用
window.adminWebsocket = websocket;
} catch (e) {
console.error('初始化 websocket 失败:', e);
}
}
/**
* 消息处理
* @param data
*/
function handleWebSocketMessage(data) {
// 处理不同类型的消息
switch (data.type) {
case 'notice':
// 显示通知消息
let message = data.data.content ? data.data.content : "您收到一条新的系统通知,请及时查看";
showNotification(message);
_index_vue_obj.countNotice++;
_index_vue_obj.notice = [data.data].concat(_index_vue_obj.notice);
// 播放提示音
playNotificationSound();
break;
case 'heartbeat':
// 收到pong响应时清除超时定时器
if (pongTimeout) {
clearTimeout(pongTimeout);
pongTimeout = null;
}
console.log('websocket 心跳检测正常');
break;
default:
console.log('Received message:', data);
}
}
function showNotification(message) {
layer.msg(message, {
time: 5000,
icon: 1,
offset: 't', // t表示顶部显示
anim: 0, // 使用淡入淡出动画
isOutAnim: false // 关闭移出动画
});
}
// 新增播放提示音函数
function playNotificationSound() {
// 先判断音频是否加载完成 + 浏览器是否允许播放(需用户曾交互过页面)
if (!isAudioLoaded) {
console.log('音频未加载完成,无法播放');
return;
}
// 尝试播放,处理浏览器限制(如未交互导致的失败)
$audio[0].currentTime = 0; // 重置播放位置(避免重复通知时只播后半段)
$audio[0].play()
.then(() => {
console.log('通知音频播放成功');
})
.catch(err => {
console.error('播放失败(可能需用户先点击页面):', err.message);
// 可选:提示用户点击页面激活音频
alert('请先点击页面任意位置,启用通知音效');
});
}
// 提供全局发送消息的方法
window.sendWebSocketMessage = function (message) {
if (window.adminWebsocket &&
window.adminWebsocket.readyState === WebSocket.OPEN) {
window.adminWebsocket.send(JSON.stringify(message));
} else {
console.warn('websocket 未连接');
}
};
</script>
</html>
+9 -1
View File
@@ -113,12 +113,17 @@
}
function getCode(obj) {
settime($(obj));
let mobile = "<?=$mobile?>";
let need_code = $('[name="need_code"]').val();
if (need_code == 'logsms'){
mobile = $('[name="number"]').val();
}
if(!mobile){
layer.msg("请输入手机号")
return false
}
settime($(obj));
$('[name="need_code"]').val('get');
$.ajax({
'url': 'get_code',
@@ -131,6 +136,9 @@
if (need_code == 'logsms'){
$('[name="need_code"]').val(need_code);
}
},
error: function(xhr, status, error) {
console.error('Error:', error);
}
})
}
+564 -50
View File
@@ -1,7 +1,18 @@
<style>
.el-input__inner {
background-color: white !important;
}
.el-input__inner {
height: 36.8px;
/* 设置输入框高度 */
</style>
</style>
<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 mb25" >
<div class="col-sm-12 mb25">
<div class="col-sm-2" style="padding-left: 0px;">
<div class="my-panel">
<div class="text-center">
@@ -61,14 +72,15 @@
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">客户姓名:</div>
<input style="width: 100px;" type="text" v-model="info.name" placeholder="请输入客户姓名">
<input style="width: 100px;" type="text" v-model="info.name"
placeholder="请输入客户姓名">
</div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">手机号码:</div>
{{infoShow.mobile_sub}}
<a href="javascript:void(0);" data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues" class="am-btn am-btn-sm am-btn-success ml20" data-title="获取手机号">拨打</a>
<input style="width: 150px;" type="text" v-model="info.mobile"
placeholder="请输入手机号">
<!--a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=clues" data-title="发送短信" class="am-btn am-btn-sm am-btn-success ml10">短信</a-->
</div>
</td>
@@ -84,6 +96,29 @@
</select>
</div>
</td>
<td class="table-td">
<div class="input-group-addon">关注车型:</div>
<div class="input-group-addon">
<el-select v-model="info.brand_id" filterable placeholder="请选择" clearable>
<el-option
v-for="item in brandAry"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!--
<select name="info.brand_id" v-model="info.brand_id">
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
-->
</div>
<div class="input-group-addon" style="width:160px;">
<select name="info.series_id" v-model="info.series_id" class="ml5">
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="table-td">
@@ -115,7 +150,7 @@
<option :value="i" v-for="(v,i) in cfroms">{{v}}</option>
</select>
</div>
<div class="input-group-addon">
<div class="input-group-addon" style="width:160px;">
<select name="info.cf2_id" v-model="info.cf2_id" class="ml5">
<option value="0">请选择</option>
<option :value="i" v-for="(v,i) in cfroms2">{{v}}</option>
@@ -137,10 +172,53 @@
</div>
</td>
</tr>
<tr>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">意向购车周期:</div>
<el-select clearable v-model="info.buy_time">
<el-option label="请选择" value="0"></el-option>
<el-option
v-for="(item,index) in buyTimeList"
:key="index"
:label="item"
:value="index">
</el-option>
</el-select>
</div>
<!--
<div class="input-group">
<div class="input-group-addon">平安推荐:</div>
<el-select v-model="info.cf_pid" filterable placeholder="请选择" clearable>
<el-option
v-for="item in paicUser"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
-->
</td>
<td class="table-td">
</td>
</tr>
<tr>
<td class="table-td">
<div class="input-group" style="margin-left: 30px;">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(2)" >保存</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit(2)">保存</a>
<!--
<a href="javascript:void(0);"
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues"
class="am-btn am-btn-sm am-btn-danger ml20" data-title="获取手机号">拨打</a>
-->
<a data-ajax="get" data-action="/common/bind_mobile"
data-params-id="<?= $info['id'] ?>" data-params-type="clues"
class="am-btn am-btn-sm am-btn-danger ml20">
拨打
</a>
</div>
</td>
</tr>
@@ -148,6 +226,39 @@
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
留资记录
</span>
</div>
<div class="am-panel-bd">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="sid" label="编号">
</el-table-column>
<el-table-column prop="mobile" label="手机号">
</el-table-column>
<el-table-column prop="brandName" label="关注品牌车型">
</el-table-column>
<el-table-column prop="cfrom2" label="留资渠道">
</el-table-column>
<el-table-column prop="c_time" label="时间">
</el-table-column>
</el-table>
<el-pagination
class="mt10 text-center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next"
:total="total">
</el-pagination>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
@@ -160,44 +271,81 @@
<tr>
<td class="table-td">
<div class="am-para-inline ml30">派单门店:</div>
<div class="am-para-inline w100" style="margin: 0">
<select name="info.province_id_admin" v-model="info.province_id_admin">
<option value="0">省份</option>
<option :value="v.province_id" v-for="(v,i) in admins.provinceAry">{{v.province_name}}</option>
</select>
</div>
<div class="am-para-inline w100">
<select name="info.city_id_admin" v-model="info.city_id_admin">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w180">
<select name="info.county_id_admin" v-model="info.county_id_admin" class="w180">
<option value="0">行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w180">
<select name="info.biz_id" v-model="info.biz_id">
<option value="0">门店</option>
<option :value="v.id" v-for="(v,i) in admins.bizAry">{{v.title}}</option>
</select>
</div>
<div class="am-para-inline" style="margin-left: 30px;">
<?php if($info['biz_id']){ ?>
<?php if(!$info['customer_id']){ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-danger" @click="saveEdit(4)">转交门店跟踪</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(5)">改派门店</a>
<?php }else{ ?>
<a href="javascript:void(0)" data-open="/receiver/customer/get?id=<?=$info['customer_id']?>" class="am-btn am-btn-sm am-btn-default">门店跟进中</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(5)">另派门店</a>
<?php }} else{ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(3)">确认派单</a>
<?php }?>
</div>
<template v-if="info.app_id==1">
<div>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="brandModal1">+选择门店</a>
<el-tag v-for="item in selectedBrands1" class="ml5" closable
@close="delCustomer(item)">{{item.name}}
</el-tag>
</div>
</template>
<template v-else>
<div class="am-para-inline w100" style="margin: 0">
<select name="info.province_id_admin" v-model="info.province_id_admin">
<option value="0">省份</option>
<option :value="v.province_id" v-for="(v,i) in admins.provinceAry">
{{v.province_name}}
</option>
</select>
</div>
<div class="am-para-inline w100">
<select name="info.city_id_admin" v-model="info.city_id_admin">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w180">
<select name="info.county_id_admin" v-model="info.county_id_admin" class="w180">
<option value="0">行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w180">
<select name="info.biz_id" v-model="info.biz_id">
<option value="0">门店</option>
<option :value="v.id" v-for="(v,i) in admins.bizAry">{{v.title}}</option>
</select>
</div>
<div class="am-para-inline" style="margin-left: 30px;">
<?php if ($info['biz_id']) { ?>
<?php if (!$info['customer_id']) { ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-danger"
@click="saveEdit(4)">转交门店跟踪</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit(5)">改派门店</a>
<?php } else { ?>
<a href="javascript:void(0)"
data-open="/receiver/customer/get?id=<?= $info['customer_id'] ?>"
class="am-btn am-btn-sm am-btn-default">门店跟进中</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit(5)">另派门店</a>
<?php }
} else { ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit(3)">确认派单</a>
<?php } ?>
</div>
</template>
</td>
</tr>
<tr>
<template v-if="info.app_id==1">
<td class="table-td">
<!--
<div class="am-para-inline ml30">回收时间:</div>
<div class="am-para-inline w200">
<input type="text" autocomplete="off" id="id-create-time"
v-model="info.rec_time">
</div>
-->
<div class="am-para-inline ml30">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveCustomer()">确认派单</a>
</div>
</td>
</template>
</tr>
</table>
</div>
</div>
@@ -252,18 +400,144 @@
</div>
<div id="log-modal" style="display: none;">
<div style="padding-top: 20px;">
<!--
<div class="am-form-group">
<label class="am-para-label label-width">内容</label>
<div class="am-para-input" style="width: 80%">
<label class="am-para-label label-width w150">意向购车周期</label>
<div class="am-para-input">
<el-select clearable v-model="goods.buy_time">
<el-option
v-for="(item,index) in buyTimeList"
:key="index"
:label="item"
:value="index">
</el-option>
</el-select>
</div>
</div>
-->
<div class="am-form-group" v-if="info.app_id==1 && info.pingan_user_id>0">
<label class="am-para-label label-width w150">通知平安坐席:</label>
<div class="am-para-input wp80" style="margin-left: 150px;line-height: 40px">
<input type="checkbox" v-model="goods.notice">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label label-width w150">内容:</label>
<div class="am-para-input wp80" style="margin-left: 150px">
<textarea name="log" rows="5" placeholder="请输入内容" v-model="goods.log"></textarea>
</div>
</div>
</div>
</div>
<div id="brand-modal1" 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">
<el-select v-model="search_info.brand_id" filterable placeholder="品牌" clearable>
<el-option
v-for="item in brandAry"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="城市" v-model="info.province_id_admin">
<option value="0">省份</option>
<template v-for="(v,i) in admins.provinceAry">
<option :value="v.province_id">{{v.province_name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="城市" v-model="info.city_id_admin">
<option value="0">城市</option>
<template v-for="(v,i) in admins.cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="行政区" v-model="info.county_id_admin">
<option value="0">行政区</option>
<template v-for="(v,i) in admins.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="search1()">搜索</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 brandsList1">
<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="addItem1(i)">添加
</button>
<button type='button' v-if="v.is_checked==1" class="btn btn-sm btn-danger"
@click="removeItem1(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="beforeShopPage1();" aria-label="上一页">
<span class="glyphicon glyphicon-menu-left"></span>
</a>
</li>
<li v-if="brandsPage.hasNext">
<a href="javascript:void(0);" @click="afterShopPage1();" aria-label="下一页">
<span class="glyphicon glyphicon-menu-right"></span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
laydate.render({
elem: '#id-create-time',
type: 'datetime'
});
});
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
@@ -271,13 +545,32 @@
data: {
info: {},
infoShow: {},
goods: {"imgs_url": [], "imgs": [], "log": ''},
goods: {log: '', id: <?=$info['id']?>, type: 0, buy_time: '', notice: false},
provinceAry: [],
cityAry: [],
countyAry: [],
cfroms: [],
cfroms2: [],
admins: {provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>, cityAry: [], countyAry: [], bizAry: []},
brandAry: [],
seryAry: [],
admins: {
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
cityAry: [],
countyAry: [],
bizAry: []
},
paicUser: [],
search_info: {province_id: 0, city_id: 0, county_id: 0, brand_id: ''},
brandsPage: [],
bizIds: [],
brandsList1: [],
brandsThPage: 0,
selectedBrands1: [],
tableData: [],
currentPage: 1,
total: 0,
pageSize: 10,
buyTimeList: []
},
mounted: function () {
var that = this;
@@ -285,14 +578,43 @@
that.infoShow = <?=json_encode($info_show)?>;
that.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
that.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
that.selectedBrands1 = <?=json_encode($selectedBrands1, JSON_UNESCAPED_UNICODE)?>;
that.buyTimeList = <?=json_encode($buyTimeList, JSON_UNESCAPED_UNICODE)?>;
that.init_provinces();
that.init_brands();
that.get_series();
this.loadPaicUser();
},
computed: {},
created: function () {
this.loadModelList();
},
updated: function () {
},
methods: {
loadPaicUser() {
let that = this
$.get('/common/get_paic_users', {}, function (response) {
that.paicUser = response.data
})
},
init_brands: function () {
var vm = this;
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
vm.brandAry = response.data;
})
},
get_series: function () {
var vm = this;
vm.seryAry = {};
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.info.brand_id}, function (response) {
vm.seryAry = response.data;
// if (if_reset) {
// vm.params.series_id = 0;
// vm.params.car_id = 0;
// }
})
},
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
@@ -372,9 +694,7 @@
url: '/receiver/clues/add_log',
type: 'post',
dataType: 'json',
data: {
act_type: 1, id: <?= $info['id'] ?>, type: 0, log: vm.goods.log, imgs: vm.goods.imgs
},
data: vm.goods,
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
@@ -401,9 +721,10 @@
},
saveEdit: function (editType) {
var vm = this;
if(editType != ''){
if (editType != '') {
vm.info.editType = editType;
}
vm.info.rec_time = $("#id-create-time").val();
$.ajax({
url: '/receiver/clues/edit',
type: 'post',
@@ -439,9 +760,202 @@
var classArr = ['default', 'primary', 'success', 'info', 'warning', 'danger'];
var rand = Math.floor(Math.random() * classArr.length);
return classArr[rand]
},
brandModal1: function () {
var that = this;
layer.open({
type: 1,
area: ['60%', '80%'], //宽高
content: $('#brand-modal1'),
title: '选择门店',
shade: false,
btn: ['选好了'],
yes: function (index) {
layer.close(index);
}
});
$.ajax({
url: '/common/shop_app',
type: 'post',
dataType: 'json',
data: {
type: [1, 5],
page: that.brandsThPage,
province_id: that.info.province_id_admin,
city_id: that.info.city_id_admin,
county_id: that.info.county_id_admin,
unset_city_limit: 1,
car_brand_id: that.search_info.brand_id,
},
success: function (json) {
var brandsList1 = json.data.shopList;
that.brandsPage = json.data.shopPage;
brandsList1.map(function (_item, _index) {
for (var index in that.selectedBrands1) {
var item = that.selectedBrands1[index];
var id = that.sys_type_id == 1 ? item.brand_id : item.biz_id;
if (id == _item.id) {
brandsList1[_index].is_checked = 1;
break;
} else {
brandsList1[_index].is_checked = 0;
}
}
})
that.brandsList1 = brandsList1;
}
});
},
//group_id1
search1: function () {
this.changePage1(1);
},
changePage1: function (page) {
var that = this;
that.brandsThPage = page;
return this.brandModal1();
},
beforeShopPage1: function () {
var vm = this;
if (vm.brandsThPage == 1) {
alert('已经是第一页了');
return;
}
vm.brandsThPage--;
return this.brandModal1();
},
afterShopPage1: function () {
var vm = this;
vm.brandsThPage++;
return this.brandModal1();
},
addItem1: function (index) {
var vm = this;
var brand_id;
var biz_id;
biz_id = vm.brandsList1[index]['id'];
var _shop = {
biz_id: biz_id,
name: vm.brandsList1[index]['name'],
};
vm.selectedBrands1.push(_shop);
vm.brandsList1[index]['is_checked'] = 1;
},
removeItem1: function (item) {
var vm = this;
this.selectedBrands1 = this.selectedBrands1.filter(function (_item) {
var id = _item.biz_id > 0 ? _item.biz_id : _item.brand_id;
return id != item.id;
})
this.brandsList1.map(function (_item, _index) {
if (item.id == _item.id) {
vm.brandsList1[_index].is_checked = 0;
}
})
},
//派单到客户池
saveCustomer: function () {
var vm = this;
vm.info.rec_time = $("#id-create-time").val();
$.ajax({
url: '/receiver/clues/add_customer',
type: 'post',
dataType: 'json',
data: {
bizList: vm.selectedBrands1,
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 () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
},
});
},
delCustomer(item) {
var vm = this;
layer.confirm('您确定要删除?', {icon: 3, title: '提示'}, function (index) {
layer.close(index);
$.ajax({
url: '/receiver/clues/edit_customer',
type: 'post',
dataType: 'json',
data: {
bizId: item.biz_id,
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');
},
});
});
},
handleSizeChange(size) {
this.pageSize = size;
this.currentPage = 1;
this.loadModelList();
},
handleCurrentChange(obj) {
console.log(obj);
this.loadModelList();
},
loadModelList() {
let that = this;
$.get('receiver/clues/lists_enroll', {
id: <?=$info['id']?>,
page: that.currentPage,
size: that.pageSize
}, function (response) {
if (response.code) {
that.tableData = response.data.list;
that.total = response.data.count;
} else {
layer.msg(response.msg, {icon: 2});
}
})
}
},
watch: {
'info.brand_id': function (nv, ov) {
if (nv !== '') {
this.get_series()
}
},
'info.province_id': function (nv, ov) {
var that = this;
if (nv == '') {
+188 -32
View File
@@ -1,11 +1,22 @@
<style>
.el-input__inner {
background-color: white!important;
}
</style>
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post"
style="padding-top: 10px;padding-bottom: 10px;"
action="" id="edit-form">
<div class="am-form-group">
<label class="am-para-label">姓名:</label>
<div class="am-para-input w150">
<div class="am-para-inline w150">
<input type="text" placeholder="输入姓名" v-model="info.name" name="name"/>
</div>
<div class="am-para-inline w100">
<input type="radio" v-model="info.sex" name="sex" value="先生"> <label
style="text-align: center;font-size: 1.6rem;line-height: 37px;">先生</label>
<input type="radio" v-model="info.sex" name="sex" value="女士"><label
style="text-align: center;font-size: 1.6rem;line-height: 37px;">女士</label>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">手机号:</label>
@@ -13,28 +24,6 @@
<input type="text" placeholder="输入手机号" v-model="info.mobile" name="mobile" maxlength="11"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">所在地区:</label>
<div class="am-form-group am-para-inline w100">
<select name="province_id" v-model="info.province_id">
<option value="0">省份</option>
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w100">
<select name="city_id" v-model="info.city_id">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w100">
<select name="county_id" v-model="info.county_id">
<option value="0">行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl" style="width:1920px">
<label class="am-para-label w110">派单门店:</label>
<div class="am-para-inline w100">
@@ -62,6 +51,27 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">所在地区:</label>
<div class="am-form-group am-para-inline w100">
<select name="province_id" v-model="info.province_id">
<option value="0">省份</option>
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w100">
<select name="city_id" v-model="info.city_id">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w100">
<select name="county_id" v-model="info.county_id">
<option value="0">行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">来源:</label>
@@ -76,9 +86,55 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">关注车型:</label>
<div class="am-para-inline w160">
<el-select v-model="info.brand_id" filterable placeholder="请选择" clearable>
<el-option
v-for="item in brandAry"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!--
<input type="text" v-model="inputValue" @input="handleInput" placeholder="输入品牌">
<ul class="am-dropdown-content" :style="'display:'+[showSelect?'block':'none']">
<li v-for="item in inputSelect">
<a href="javascript:;" @click="selectInput(item)">{{item.name}}</a>
</li>
</ul>
-->
</div>
<div class="am-para-inline w160">
<select name="series_id" v-model="info.series_id">
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">平安推荐:</label>
<div class="am-para-inline">
<el-select v-model="info.cf_pid" filterable placeholder="请选择" clearable>
<el-option
v-for="item in paicUser"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">填写小记:</label>
<div class="am-para-inline">
<textarea v-model="info.text" style="width: 600px; height: 100px;"></textarea>
</div>
</div>
<div class="am-form-group">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="button" id="add-btn" @click="saveEdit">保存</button>
<button class="am-btn am-btn-danger" type="button" id="push-btn" @click="savePush">保存并转交</button>
</div>
</div>
</form>
@@ -90,22 +146,34 @@
el: '#edit-form',
data: {
info: {},
province_idn:0,
city_id:0,
county_id:0,
province_id_admin:0,
city_id_admin:0,
county_id_admin:0,
biz_id_admin:0,
province_id: <?=$limit_province_id?>,
city_id: 0,
county_id: 0,
province_id_admin: <?=$limit_province_id?>,
city_id_admin: 0,
county_id_admin: 0,
biz_id_admin: 0,
cfromAry: [],
cfromAry2: [],
provinceAry: [],
cityAry: [],
countyAry: [],
admins: {provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>, cityAry: [], countyAry: [], bizAry: []},
brandAry: [],
seryAry: [],
admins: {
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
cityAry: [],
countyAry: [],
bizAry: []
},
action: "",
inputValue: "",
showSelect: false,
inputSelect: [],
paicUser: []
},
mounted: function () {
this.get_brand();
this.init_provinces();
this.init_citys();
this.init_countys();
@@ -113,8 +181,52 @@
this.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
this.cfromAry = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
this.action = "<?=$action?>";
this.loadPaicUser();
// this.init_brands();
// this.get_series();
},
methods: {
loadPaicUser() {
let that = this
$.get('/common/get_paic_users', {}, function (response) {
that.paicUser = response.data
})
},
// selectInput: function (item) {
// console.log(item)
// this.inputValue = item.name
// this.info.brand_id = item.id
// this.showSelect = false
// },
// handleInput: function (event) {
// console.log('输入值:', this.inputValue);
// // 请求接口
// var that = this;
// $.get('/common/auto_search', {'name': this.inputValue}, function (response) {
// that.inputSelect = response.data;
// setTimeout(function () {
// if (that.inputSelect && that.inputSelect.length > 0) {
// that.showSelect = true
// } else {
// that.showSelect = false
// }
// }, 100)
// })
// },
get_brand: function () {
var vm = this;
vm.brandAry = {};
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
vm.brandAry = response.data;
})
},
get_series: function () {
var vm = this;
vm.seryAry = {};
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.info.brand_id}, function (response) {
vm.seryAry = response.data;
})
},
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
@@ -130,7 +242,7 @@
vm.cityAry = response.data;
}
});
$.get('common/area', {id: vm.province_id_admin, key: 'city', type: 1}, function (response) {
$.get('common/area', {id: <?=$limit_province_id?>, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.admins.cityAry = response.data;
}
@@ -176,6 +288,45 @@
loading = 1;
vm.info.biz_id = vm.biz_id_admin;
$.ajax({
url: "receiver/clues/" + vm.action,
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (1 == data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.href('/receiver/clues');
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
}
});
},
savePush: function () {
var vm = this;
if (loading) {
return;
}
loading = 1;
vm.info.biz_id = vm.biz_id_admin;
vm.info.push = 1;
$.ajax({
url: "receiver/clues/" + vm.action,
type: 'post',
@@ -208,6 +359,11 @@
},
},
watch: {
'info.brand_id': function (nv, ov) {
if (nv !== '') {
this.get_series()
}
},
'info.province_id': function (nv, ov) {
var that = this;
if (nv == '') {
+56
View File
@@ -0,0 +1,56 @@
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post"
style="padding-top: 10px;padding-bottom: 10px;"
action="/receiver/clues/edit_admins" id="edit-form">
<div class="am-form-group">
<label class="am-para-label">跟进人员:</label>
<div class="am-para-input w300">
<select name="biz_id" v-model="admin_id">
<option value="">请选择用户</option>
<template v-for="(v,i) in adminList">
<option :value="v.id">{{v.username}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group">
<div class="am-para-input">
<input type="hidden" name="ids" value="<?= $ids ?>">
<button class="am-btn am-btn-secondary" type="button" @click="save()">保存分配</button>
</div>
</div>
</form>
<script>
$(function () {
vue_obj = new Vue({
el: '#edit-form',
data: {
adminList: [],
admin_id: ''
},
mounted: function () {
this.adminList = <?=$adminLists ? json_encode($adminLists, JSON_UNESCAPED_UNICODE) : '{}'?>;
},
methods: {
save: function () {
if (!this.admin_id) {
layer.msg('请选择跟进人员', {'icon': 2});
return false
}
pdata = {'admin_id': this.admin_id, 'ids': '<?=$ids?>'}
$.post('receiver/clues/edit_admins', pdata, function (response) {
if (response.code == 1) {
layer.msg(response.msg, {'icon': 1}, function () {
layer.closeAll();
$.form.reload();
})
} else {
layer.msg(response.msg, {'icon': 2});
}
});
}
},
watch: {}
})
});
</script>
+1 -1
View File
@@ -54,7 +54,7 @@
province_id: <?=$params['province_id'] ? $params['province_id'] : 0?>,
city_id: <?=$params['city_id'] ? $params['city_id'] : 0?>,
county_id: <?=$params['county_id'] ? $params['county_id'] : 0?>,
provinceAry: [{"id": "350000", "name": "福建省"}, {"id": "430000", "name": "湖南省"}],
provinceAry: [{"id": "350000", "name": "福建省"}, {"id": "430000", "name": "湖南省"},{"id": "520000", "name": "贵州省"},{"id": "460000", "name": "海南省"},{"id": "440000", "name": "广东省"}],
cityAry: [],
countyAry: [],
bizList: [],
+179 -21
View File
@@ -1,4 +1,13 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<style>
.el-input__inner {
background-color: white !important;
}
.el-input__inner {
height: 32.4px !important; /* 设置输入框高度 */
}
</style>
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
@@ -49,6 +58,7 @@
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/receiver/clues" id="search_form">
<input name="status" value="<?= $params['status'] ?>" type="hidden">
<input name="status2" value="<?= $params['status2'] ?>" type="hidden">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
@@ -66,6 +76,32 @@
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<?php if ($role == 1) { ?>
<div class="am-form-group fl">
<label class="am-para-label w100">客户归属:</label>
<div class="am-para-inline w100">
<select name="belong_id">
<option value=0>请选择</option>
<option value=10>厦门</option>
<option value=38>贵阳</option>
<option value=39>海口</option>
<option value=99>佛山</option>
</select>
</div>
</div>
<?php } else { ?>
<input name="belong_id" value="<?= $params['belong_id'] ?>" type="hidden">
<?php } ?>
<div class="am-form-group fl">
<label class="am-para-label w100">客户等级:</label>
<div class="am-para-inline w100">
<select name="level" v-model="level">
<option value="">请选择</option>
<option :value="item" v-for="item in levelList">{{item}}</option>
</select>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">线索来源:</label>
<div class="am-form-group am-para-inline w150">
@@ -128,16 +164,49 @@
</select>
</div>
</div>
<div class="am-form-group fl" style="width:1920px">
<label class="am-para-label w100">添加微信</label>
<div class="am-para-inline w100">
<select title="添加微信" name="wxgr">
<option value="2">全部</option>
<option value="1" <?= $params['wxgr'] == 1 ? 'selected' : '' ?>>是</option>
<option value="0" <?= $params['wxgr'] == 0 ? 'selected' : '' ?>>否</option>
</select>
<div class="am-form-group fl">
<label class="am-para-label w100">重点关注车型</label>
<div class="am-para-inline w120">
<input type="hidden" name="brand_id" v-model="brand_id">
<el-select v-model="brand_id" filterable placeholder="请选择" clearable size="small">
<el-option
v-for="item in brandAry"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!--
<select name="brand_id" v-model="brand_id">
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
-->
</div>
<div class="am-para-inline w120">
<select name="series_id" v-model="series_id">
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl" style="width:100%">
<label class="am-para-label w100">添加微信:</label>
<div class="am-para-inline w100">
<select title="添加微信" name="wxgr">
<option value="">全部</option>
<option value="1" <?= $params['wxgr'] == '1' ? 'selected' : '' ?>>是</option>
<option value="0" <?= $params['wxgr'] == '0' ? 'selected' : '' ?>>否</option>
</select>
</div>
<label class="am-para-label w100">跟进人员:</label>
<div class="am-form-group am-para-inline w150">
<select name="admin_id" v-model="admin_id">
<option value="">所有</option>
<option value="0">无</option>
<option :value="v.id" v-for="(v,i) in adminAry">{{v.username}}</option>
</select>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">创建时间:</label>
<div class="am-form-group fl">
@@ -146,17 +215,36 @@
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 class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="create"
data-source="id-create-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="create"
data-source="id-create-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="create"
data-source="id-create-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="create"
data-source="id-create-time">本月</a>
</div>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w100">分配时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-p-time" name="p_time" type="text" value="<?= $params['p_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="today" data-btn="p"
data-source="id-p-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="p"
data-source="id-p-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="p"
data-source="id-p-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="p"
data-source="id-p-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml30">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
@@ -171,13 +259,19 @@
</button>
</div-->
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
onclick="edit_counselor();">分配
</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="import" 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"
data-modal="/receiver/clues/get_add" data-title="新增线索">新增
data-open="/receiver/clues/get_add" data-title="新增线索">新增
</button>
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out()"
title="最多500条" v-if="export_button">导出
@@ -198,9 +292,9 @@
<th width="12%"><span>线索来源</span></th>
<th width="12%"><span>所在地区</span></th>
<th width="12%"><span>所派门店</span></th>
<th width="5%"><span>状态</span></th>
<th width="12%"><span>创建时间</span></th>
<th width="15%"><span>跟进人员</span></th>
<th width="8%"><span>状态</span></th>
<th width="15%"><span>时间</span></th>
<th width="10%"><span>跟进人员</span></th>
</tr>
</thead>
<tbody>
@@ -215,8 +309,16 @@
<td style="vertical-align: middle;"><?= $v['cf_title'] ?></td>
<td style="vertical-align: middle;"><?= $v['poi'] ?></td>
<td style="vertical-align: middle;"><?= $v['biz_poi'] ?><br><?= $v['biz_name'] ?></td>
<td style="vertical-align: middle;"><?= $v['status_name'] ?></td>
<td style="vertical-align: middle;"><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
<td style="vertical-align: middle;">
<?= $v['status_name'] ?><br>
<?= $v['is_unlock'] ?>
</td>
<td style="text-align: left">
分配时间: <?= $v['p_time'] ?><br>
派单过期: <?= $v['rec_time'] ?><br>
创建时间: <?= date('Y-m-d H:i:s', $v['c_time']) ?><br>
更新时间: <?= $v['u_time'] ?><br>
</td>
<td style="vertical-align: middle;"><?= $v['admin_name'] ?></td>
</tr>
<? }
@@ -265,11 +367,15 @@
biz_id_admin: <?=$params['biz_id_admin'] ? $params['biz_id_admin'] : 0?>,
cfrom_id: <?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2: <?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
brand_id: '<?=$params['brand_id'] ? $params['brand_id'] : ''?>',
series_id: <?=$params['series_id'] ? $params['series_id'] : 0?>,
cfroms: [],
cfroms2: [],
provinceAry: [],
cityAry: [],
countyAry: [],
brandAry: [],
seryAry: [],
admins: {
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
cityAry: [],
@@ -277,6 +383,10 @@
bizAry: []
},
export_button: <?=$export_button?>,
admin_id: <?=strlen($params['admin_id']) ? $params['admin_id'] : '""'?>,
adminAry: <?=$adminLists ? json_encode($adminLists) : '[]'?>,
levelList: <?=$levelList ? json_encode($levelList) : '[]'?>,
level: "<?=$params['level'] ? $params['level'] : ''?>",
},
mounted: function () {
this.init_provinces();
@@ -285,8 +395,23 @@
this.init_bizs();
this.cfroms = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
this.cfroms2 = <?=json_encode($cfromAry2, JSON_UNESCAPED_UNICODE)?>;
this.init_brands();
this.get_series();
},
methods: {
init_brands: function () {
var vm = this;
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
vm.brandAry = response.data;
})
},
get_series: function () {
var vm = this;
vm.seryAry = {};
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.brand_id}, function (response) {
vm.seryAry = response.data;
})
},
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
@@ -345,6 +470,7 @@
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
$('#id-p-time').val('');
that.province_id = '0';
that.city_id = '0';
that.county_id = '0';
@@ -353,7 +479,9 @@
that.county_id_admin = '0';
that.biz_id_admin = '0';
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.cfrom_id = 0;
that.brand_id = 0;
that.series_id = 0;
},
export_out: function () {
var that = this;
@@ -372,6 +500,12 @@
},
},
watch: {
'brand_id': function (nv, ov) {
if (nv !== '') {
this.get_series()
}
},
'province_id': function (nv, ov) {
var that = this;
if (nv == '') {
@@ -541,13 +675,16 @@
}
});
});
$("#batch_allot").click(function () {
alert()
})
});
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
laydate.render({
elem: '#id-en-time', range: '~'
elem: '#id-p-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
@@ -573,7 +710,15 @@
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
//$('#' + source_id).val(date);
switch ($(this).data('btn')) {
case 'create':
$('#id-create-time').val(date);
break;
case 'p':
$('#id-p-time').val(date);
break;
}
});
});
@@ -590,6 +735,19 @@
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
}
function edit_counselor() {
var ids = function () {
var data = [];
return $(".order-ids").map(function () {
(this.checked) && data.push(this.value);
}), data.join(',');
}.call(this);
if (ids.length < 1) {
return $.msg.tips('请选择需要操作的数据!');
}
return $.form.modal("/receiver/clues/edit_admins?ids=" + ids, 'open_type=modal', "分配跟进人员");
}
function load_clue() {
var file = $("#clue-file");
if (file.val() == '') {
+13 -9
View File
@@ -44,10 +44,19 @@
<tr>
<td class="table-td"><span class="mr5">客户姓名:</span>{{info.name}}</td>
<td class="table-td"><span class="mr5">客户电话:</span>{{info.mobile}}
<a href="javascript:void(0);" data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=customer"
class="am-btn am-btn-sm am-btn-success ml5" data-title="获取手机号">
<a data-ajax="get" data-action="/common/bind_mobile"
data-params-id="<?= $info['id'] ?>" data-params-type="customer"
class="am-btn am-btn-sm am-btn-success ml5" v-if="info.role!=8">
拨打
</a>
<!--
<a href="javascript:void(0);"
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=customer"
class="am-btn am-btn-sm am-btn-success ml5" data-title="获取手机号"
v-if="info.role!=8">
拨打
</a>
-->
</td>
<td class="table-td"><span class="mr5">归属门店:</span>{{info.biz}}</td>
@@ -61,15 +70,10 @@
<tr>
<td class="table-td"><span class="mr5">{{info.time_name}}:</span>{{info.p_time}}</td>
<td class="table-td"><span class="mr5">微信好友:</span>{{info.wx_name}}</td>
<td class="table-td"><span class="mr5">重点关注车型:</span>{{info.brand_detail}}</td>
</tr>
<tr>
<td>
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-left pt10" v-if="edit_index==2">
</div>
</div>
</td>
<td class="table-td"><span class="mr5">平安推荐:</span>{{info.cf_name}}</td>
</tr>
</table>
</div>
+67 -9
View File
@@ -32,6 +32,16 @@
<input id="cid" name="cid" type="text" v-model="params.cid"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">客户状态:</label>
<div class="am-para-inline w100">
<select name="status" v-model="params.status">
<option value=''>请选择</option>
<option :value="i" v-for="(v,i) in status_arr">{{v}}</option>
</select>
</div>
</div>
<div class="fl" style="width:1920px">
<label class="am-para-label w80">客户等级:</label>
@@ -149,6 +159,20 @@
</select>
</div>
</div>
<div class="am-form-group fl" style="width:1920px">
<label class="am-para-label w100">重点关注车型:</label>
<div class="am-para-inline w120">
<select name="brand_id" v-model="params.brand_id">
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="series_id" v-model="params.series_id">
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
</div>
<? foreach ($searchTimeAry as $key => $value) { ?>
<div id="show-<?= $key ?>" style="display:<?= $params[$key] ? 'block' : 'none' ?>">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
@@ -198,7 +222,6 @@
</div>
</div>
</div>
<input name="status" value="<?= $params['status'] ?>" type="hidden">
<input type="hidden" id="id_tags" name="tags" value="<?= $params['tags'] ?>">
<input type="hidden" id="id_tagsIntention" name="tagsIntention" value="<?= $params['tagsIntention'] ?>">
<input type="hidden" id="id_tagsDefeat" name="tagsDefeat" value="<?= $params['tagsDefeat'] ?>">
@@ -211,22 +234,21 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%">编号</th>
<th width="10%"><span>客户</span></th>
<th width="6%"><span>客户等级</span></th>
<th width="10%"><span>客户来源</span></th>
<th width="18%"><span>所属门店</span></th>
<th width="12%"><span>客户来源</span></th>
<th width="12%"><span>所属门店</span></th>
<th width="6%"><span>车管家</span></th>
<th width="10%"><span>关注车型</span></th>
<th width="6%"><span>个微</span></th>
<th width="6%"><span>状态</span></th>
<th width="15%"><span>派单/建档时间</span></th>
<th width="15%"><span>最后联系时间</span></th>
<th width="12%"><span>派单/建档时间</span></th>
<th width="12%"><span>最后联系时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td style="vertical-align: middle;">{{v.cid}}</td>
<td style="vertical-align: middle;"><a href="javascript:void(0);"
:data-open="'/receiver/customer/get?id='+v.id">{{v.name}}<br>{{v.mobile_sub}}</a>
</td>
@@ -234,8 +256,12 @@
<td style="vertical-align: middle;">{{v.of_title}}</td>
<td style="vertical-align: middle;">{{v.biz_poi}}<br>{{v.biz_name}}</td>
<td style="vertical-align: middle;">{{v.admin_name}}</td>
<td style="vertical-align: middle;">{{v.brand_detail}}</td>
<td style="vertical-align: middle;">{{v.wxgr_name}}</td>
<td style="vertical-align: middle;">{{v.status_name}}</td>
<td style="vertical-align: middle;">
{{v.status_name}}<br>
{{v.is_unlock}}
</td>
<td style="vertical-align: middle;">{{v.p_time}}</td>
<td style="vertical-align: middle;">{{v.cont_time}}</td>
</tr>
@@ -402,12 +428,14 @@
searchTpAry: [],
lists: [],
qdjl_lists: [],
brandAry: [],
seryAry: [],
admins: {
provinceAry: <?=json_encode($provinces, JSON_UNESCAPED_UNICODE)?>,
cityAry: [],
countyAry: [],
bizAry: [],
list: []
list: [],
},
show_info: {
levelAry: [],
@@ -426,17 +454,38 @@
provinceAry: [],
cityAry: [],
countyAry: [],
status_arr: [],
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.searchTpAry = <?=json_encode($searchTpAry)?>;
vm.lists = <?=json_encode($lists)?>;
vm.status_arr = <?=json_encode($status_arr)?>;
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.export_button = <?=$export_button?>;
vm.init_brands();
vm.get_series()
},
methods: {
init_brands: function () {
var vm = this;
$.get('/common/auto', {'type': 1, 'tp': 0}, function (response) {
vm.brandAry = response.data;
})
},
get_series: function () {
var vm = this;
vm.seryAry = {};
$.get('/common/auto', {'type': 2, 'tp': 0, 'pid': vm.params.brand_id}, function (response) {
vm.seryAry = response.data;
// if (if_reset) {
// vm.params.series_id = 0;
// vm.params.car_id = 0;
// }
})
},
btnTimes: function () {
layer.open({
type: 1,
@@ -630,6 +679,8 @@
that.params.county_id_admin = '';
that.params.of_id = '';
that.params.of2_id = '';
that.params.brand_id = 0;
that.params.series_id = 0;
$('#id_tags').val('');
$('#id_tagsIntention').val('');
$('#id_tagsDefeat').val('');
@@ -660,6 +711,13 @@
},
},
watch: {
'params.brand_id': function (nv, ov) {
console.log("brand_id", nv, ov)
if (nv !== '') {
this.get_series()
}
},
'params.province_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
+24 -44
View File
@@ -57,7 +57,7 @@
</a>
<div class="tc f12">身份证正面</div>
</li>
<!--li style="position:relative;" v-if="info.img_data.cardidb">
<li style="position:relative;" v-if="info.img_data.cardidb">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','cardidb','')">x
</div>
@@ -69,7 +69,7 @@
<a :href="info.img_data.cardidb" target="_blank">查看原图</a>
</div>
</li-->
</li>
<li v-else>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cardidb" data-mark="compalbum">
@@ -81,32 +81,6 @@
</li>
</ul>
</div>
<!--
<div class="am-form-group clearfix">
<p class="am-text-default mb10 ml30 pt15 pb10">
订单合同:
</p>
<ul id="viewer-contract_img" class="photopic-list ml30 clearfix">
<li style="position:relative;" v-if="info.img_data.contract_img">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','contract_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="订单合同" onclick="showViewer('viewer-contract_img')"
:src="info.img_data.contract_img"/>
</a>
</li>
<li v-else>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="contract_img" data-mark="compalbum">
<input type="hidden" class="contract_img" name="contract_img" data-type="1" value=""
onchange="upImg('contract_img',this)">
<div></div>
</a>
</li>
</ul>
</div>
-->
<div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
@@ -161,21 +135,23 @@
</li>
</ul>
</div>
<div class="am-form-group clearfix">
<div class="am-form-group clearfix" v-if="parseInt(info.if_equity)">
<p class="am-text-default mb10 ml30 pt15 pb10">
权益确认书:
</p>
<ul id="viewer-equity_ck_img" class="photopic-list ml30 clearfix">
<li style="position:relative;" v-if="info.img_data.equity_ck_img">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','equity_ck_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="权益确认书" onclick="showViewer('viewer-equity_ck_img')"
:src="info.img_data.equity_ck_img"/>
</a>
</li>
<li v-else>
<template v-if="info.img_data.equity_ck_img.length>0">
<li style="position:relative;" v-for="(item,index) in info.img_data.equity_ck_img" :key="index">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
:onclick="'del_img(\'data\',\'equity_ck_img\',\''+item+'\')'">x
</div>
<a target="_blank" class="pic">
<img alt="权益确认书" onclick="showViewer('equity_ck_img')"
:src="item"/>
</a>
</li>
</template>
<li v-if="info.img_data.equity_ck_img.length<5">
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="equity_ck_img" data-mark="compalbum">
<input type="hidden" class="equity_ck_img" name="equity_ck_img" data-type="1" value=""
@@ -220,7 +196,9 @@
onclick="del_img('data','insurance_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="交强险" onclick="showViewer('viewer-insurance_img')"
<embed type="application/pdf" v-if="info.img_data.insurance_pdf" alt="交强险"
:src="info.img_data.insurance_pdf"/>
<img v-else alt="交强险险" onclick="showViewer('viewer-insurance_img')"
:src="info.img_data.insurance_img"/>
</a>
<div class="f12 tc">交强险</div>
@@ -239,7 +217,9 @@
onclick="del_img('data','business_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="商业险" onclick="showViewer('viewer-insurance_img')"
<embed type="application/pdf" v-if="info.img_data.business_pdf" alt="交强险"
:src="info.img_data.business_pdf"/>
<img v-else alt="商业险" onclick="showViewer('viewer-insurance_img')"
:src="info.img_data.business_img"/>
</a>
<div class="f12 tc">商业险</div>
@@ -281,7 +261,7 @@
</li>
</ul>
</div>
<div class="am-form-group clearfix">
<!--div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
实名认证:
@@ -292,7 +272,7 @@
onclick="del_img('data','car_auth_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="" onclick="showViewer('viewer-cardida')"
<img alt="" onclick="showViewer('viewer-car_auth_img')"
:src="info.img_data.car_auth_img"/>
</a>
</li>
@@ -306,7 +286,7 @@
</li>
</ul>
</div>
</div>
</div-->
<!--div class="am-form-group clearfix">
<div class="">
+9 -3
View File
@@ -109,19 +109,25 @@
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">建档时间:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.p_time}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">下单时间:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.c_time}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">订单状态:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.status_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户来源:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.of_title}}</label>
+13 -3
View File
@@ -23,7 +23,7 @@
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">定金金额:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.money_json.confirm_amount}}</label>
<label class="am-para-label-con" v-if="info.money_json">{{info.money_json.confirm_amount}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
@@ -37,7 +37,7 @@
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">车身优惠价:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.money_json.discount_amount}}</label>
<label class="am-para-label-con" v-if="info.money_json">{{info.money_json.discount_amount}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
@@ -51,7 +51,7 @@
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">上牌费:</span></label>
<div class="am-para-input" style="margin-left:120px">
<label class="am-para-label-con">{{info.money_json.register_amount}}</label>
<label class="am-para-label-con" v-if="info.money_json">{{info.money_json.register_amount}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
@@ -92,5 +92,15 @@
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">投保买贵必赔:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{parseInt(info.if_equity) ? '是':'否'}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
</div>
</div>
</div>
</div>
+43 -7
View File
@@ -86,12 +86,35 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">是否有合同:</label>
<div class="am-para-inline w100">
<select name="iscontract">
<option value="">请选择</option>
<option value="1" <?php if ($params['iscontract'] == 1){ ?>selected <?php } ?>>是</option>
<option value="2" <?php if ($params['iscontract'] == 2){ ?>selected <?php } ?>>否</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="isbill">
<option value="">请选择</option>
<option value="1" <?php if ($params['isbill'] == 1){ ?>selected <?php } ?>>是</option>
<option value="2" <?php if ($params['isbill'] == 2){ ?>selected <?php } ?>>否</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 w100">车型:</label>
<div class="am-para-inline w120">
<select name="brand_id" v-model="params.brand_id">
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
<div class="am-para-inline">
<select class="selectpicker" name="brand_id" v-model="params.brand_id" data-live-search="true">
<option value="0">所有品牌</option>
<? foreach ($brands as $v) { ?>
<option value="<?= $v['id'] ?>"><?= $v['name'] ?></option>
<? } ?>
</select>
</div>
<div class="am-para-inline w120">
@@ -152,6 +175,15 @@
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<label class="am-para-label w100">CPS品牌:</label>
<div class="am-para-inline w100">
<select name="cps_type" v-model="params.cps_type">
<option value=''>请选择</option>
<option v-for="(v,i) in cps_types" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
@@ -200,7 +232,7 @@
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
require(['laydate', 'autocomplete', 'bootstrap-select'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
@@ -249,8 +281,9 @@
break;
}
});
});
$('.selectpicker').selectpicker();
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
@@ -266,23 +299,25 @@
cityAry: [],
countyAry: [],
bizAry: [],
list: []
list: [],
},
lists: [],
of2Ary: [],
cps_types: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.init_brands();
// vm.init_brands();
if (vm.params.series_id) {
this.get_series()
}
if (vm.params.car_id) {
this.get_car()
}
vm.cps_types = <?=json_encode($cps_types, JSON_UNESCAPED_UNICODE)?>;
},
methods: {
export_out: function (type) {
@@ -338,6 +373,7 @@
that.params.county_id_id_admin = '';
that.params.biz_id_id_admin = '';
that.params.qdjl_id = '';
that.params.cps_type = '';
}
},
watch: {
+143
View File
@@ -0,0 +1,143 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
</div>
<div class="coms-table-wrap mt10" id="vue-app">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/receiver/report">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group fl">
<div class="am-para-inline">
<select class="selectpicker" name="biz_id" data-live-search="true">
<option value="0">所有门店</option>
<? foreach ($biz_lists as $item) { ?>
<option value="<?= $item['id'] ?>" <?= $item['id'] == $params['biz_id'] ? 'selected' : '' ?>><?= $item['biz_name'] ?></option>
<? } ?>
</select>
</div>
</div>
</div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline">
<input id="id-day" name="day" type="text" value="<?= $params['day'] ?>"
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">昨日</a>
</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" onclick="export_out()" class="am-btn am-btn-success am-btn-sm w100">导出
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd" id="vue-show">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>车卖场</span></th>
<th><span>日期</span></th>
<th><span>顾问数(含店长)</span></th>
<th><span>开工率</span></th>
<th><span>新增线索数</span></th>
<th><span>未及时分配数</span></th>
<th><span>新增跟进数</span></th>
<th><span>线索逾期数</span></th>
<th><span>战败申请未处理数</span></th>
<th><span>订单新增数</span></th>
<th><span>订单未达T+1</span></th>
<th><span>开票早与订单时间数</span></th>
<th><span>交付总数</span></th>
<th><span>运营分</span></th>
<th><span></span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td rowspan="2" style="vertical-align: middle;"><?= $v['biz_name'] ?></td>
<td rowspan="2" style="vertical-align: middle;"><?= $v['day'] ?></td>
<td rowspan="2" style="vertical-align: middle;"><?= $v['sales'] ?></td>
<td><?= intval($v['work_per']) ?>%</td>
<td><?= $v['cust_new'] ?></td>
<td><?= $v['cust_push'] ?></td>
<td><?= $v['cust_visit'] ?></td>
<td><?= $v['cust_delay'] ?></td>
<td><?= $v['cust_defeat'] ?></td>
<td><?= $v['order_new'] ?></td>
<td><?= $v['order_wrong'] ?></td>
<td><?= $v['order_early'] ?></td>
<td></td>
<td><?= $v['score'] ?></td>
<td>今日</td>
</tr>
<tr>
<td><?= intval($v['work_per_month']) ?>%</td>
<td><?= $v['cust_month'] ?></td>
<td><?= $v['cust_push_month'] ?></td>
<td><?= $v['cust_visit_month'] ?></td>
<td><?= $v['cust_delay_month'] ?></td>
<td><?= $v['cust_defeat_month'] ?></td>
<td><?= $v['order_month'] ?></td>
<td><?= $v['order_wrong_month'] ?></td>
<td><?= $v['order_finish'] ?></td>
<td><?= $v['order_over'] ?></td>
<td><?= $v['score_month'] ?></td>
<td>本月</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>
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-app',
data: {
optionsList: [],
},
mounted: function () {
},
methods: {},
watch: {}
});
<?php page_script($pager) ?>
});
require(['laydate', 'bootstrap-select'], function (laydate) {
laydate.render({
elem: '#id-day'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var date = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
$('#id-day').val(date);
});
$('.selectpicker').selectpicker();
});
function export_out() {
var href = $.menu.parseUri(window.location.href);
var day = $('#id-day').val();
href = href.replace("report?", "report/export?day=" + day + "&");
window.location.href = href;
}
</script>
+45 -3
View File
@@ -17,6 +17,12 @@
<input type="text" placeholder="输入手机号" value="<?=$this->data['mobile']?$this->data['mobile']:''?>" name="mobile"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">客服号:</label>
<div class="am-para-input">
<input type="text" placeholder="输入客服号" value="<?=$this->data['kf_mobile']?$this->data['kf_mobile']:''?>" name="kf_mobile"/>
</div>
</div>
<!-- <div class="am-form-group">
<label class="am-para-label">状态:</label>
<div class="am-para-inline w150">
@@ -39,6 +45,18 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">归属:</label>
<div class="am-para-inline w150">
<select v-model="belong_id" name="belong_id">
<option value="">请选择</option>
<template v-for="value in belong">
<option v-if="value.id == '<?=isset($this->data['belong_id'])?$this->data['belong_id']:''?>'" selected :value="value.id">{{value.biz_name}}</option>
<option v-else :value="value.id">{{value.biz_name}}</option>
</template>
</select>
</div>
</div>
<?php if($url == 'add') { ?>
<div class="am-form-group">
<label class="am-para-label">密码:</label>
@@ -57,6 +75,10 @@
<label class="am-para-label">门店:</label>
<div class="am-para-inline" style="width:80%">
<div>
<select style="width:100px;display:inline" v-model="province_id">
<option value="">选择省份</option>
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
</select>
<select style="width:100px;display:inline" v-model="city_id">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
@@ -88,10 +110,14 @@
var vm = new Vue({
el: '#vue-edit',
data: {
belong_id: '',
role_id: '',
belong: <?=json_encode($this->data['belong'])?>,
role: <?=json_encode($this->data['role'])?>,
province_id: '<?=$province_id?>',
city_id:'<?=$city_id?>',
county_id: '<?=$county_id?>',
provinceAry:[],
cityAry:[],
countyAry:[],
bizAry:[],
@@ -100,6 +126,7 @@
created: function(index) {
if('edit' == '<?=$url?>') {
this.role_id = '<?=$this->data['role_id']?>';
this.belong_id = '<?=$this->data['belong_id']?>';
}
},
mounted: function () {
@@ -108,9 +135,9 @@
methods: {
init_citys: function () {
var vm = this;
$.get('/common/area',{'id':350,'key':'city','type':1},function(response){
$.get('/common/area',{'id':350,'key':'province','province_limit':true},function(response){
if (response.code == 1) {
vm.cityAry = response.data;
vm.provinceAry = response.data;
}
});
},
@@ -144,6 +171,21 @@
}
},
watch: {
'province_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cityAry = [];
that.city_id = '';
that.countyAry = [];
that.county_id = '';
} else {
$.get('/common/area',{'id':nv,'key':'city','type':1},function(response){
if (response.code == 1) {
that.cityAry = response.data;
}
});
}
},
'city_id': function (nv, ov) {
var that = this;
if (nv == '') {
@@ -159,7 +201,7 @@
},
'county_id': function (nv, ov) {
var that = this;
$.post('/biz/store/store/json_lists',{city_id:that.city_id,county_id:that.county_id,status:1},function(response){
$.get('/biz/store/store/json_lists',{city_id:that.city_id,county_id:that.county_id,status:1},function(response){
if (response.code == 1) {
$.each(response.data.list,function(key,val){
response.data.list[key]['selected'] = ''
+111
View File
@@ -0,0 +1,111 @@
<form id="vue-app" class="am-form am-form-horizontal" action="/biz/store/store/add?>" data-auto="true" method="post"
style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">品牌:</label>
<div class="am-para-input w200">
<select class="selectpicker" v-model="info.brand_id" data-live-search="true">
<option v-for="value in brands" :value="value.id">{{value.name}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">类型:</label>
<div class="am-para-input w200">
<select v-model="info.type">
<option v-for="(value,index) in types" :value="index">{{value}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">有效时间:</label>
<div class="am-para-input wp60">
<div class="am-para-inline w200">
<input type="text" placeholder="开始时间" v-model="info.s_time" name="s_time"
id="datetimepicker1" autocomplete="off">
</div>
<div class="am-para-inline w200">
<input type="text" placeholder="结束时间" v-model="info.e_time" name="e_time" id="datetimepicker2"
autocomplete="off">
</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="submit">提交</button>
</div>
</div>
</form>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
info: <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>,
brands: <?=json_encode($brands, JSON_UNESCAPED_UNICODE)?>,
types: <?=json_encode($types, JSON_UNESCAPED_UNICODE)?>,
},
mounted: function () {
},
methods: {
submit: function () {
let url = "sys/cps/brand/add"
if (this.info.id) {
url = "sys/cps/brand/edit"
}
var brand_id = $('.selectpicker').val();
if (!brand_id) {
layer.msg("请选择品牌", {icon: 2})
return
}
if (!this.info.type) {
layer.msg("请选择类型", {icon: 2})
return
}
if (!this.info.s_time || !this.info.e_time) {
layer.msg("请选择有效期时间", {icon: 2})
return
}
this.info.brand_id = brand_id
$.post(url, this.info, function (data) {
if (data.code) {
layer.msg(data.msg, {
icon: 1, end: function () {
window.onhashchange.call();
}
});
} else {
layer.msg(data.msg, {icon: 2});
}
})
},
set_Stime: function (value) {
this.info.s_time = value
},
set_Etime: function (value) {
this.info.e_time = value
}
},
created: function () {
},
watch: {}
});
require(['laydate', 'bootstrap-select'], function (laydate, bootstrapSelect) {
//日期范围
laydate.render({
elem: '#datetimepicker1',
type: 'date',
done: function (value, date) {
vm.set_Stime(value)
}
});
laydate.render({
elem: '#datetimepicker2',
type: 'date',
done: function (value, date) {
vm.set_Etime(value)
}
});
$('.selectpicker').selectpicker();
});
</script>
+103
View File
@@ -0,0 +1,103 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="sys/cps/brand">
<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 w120">
<select name="status" v-model="params.status">
<option value="">选择状态</option>
<option v-for="(value,key) in status_lists" :value="key">
{{value}}
</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">类型:</label>
<div class="am-para-inline w120">
<select name="type" v-model="params.type">
<option value="">选择状态</option>
<option v-for="(value,key) in type_lists" :value="key">
{{value}}
</option>
</select>
</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 data-open="/sys/cps/brand/get" type="button" data-title="新增"
class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd" id="vue-show">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="8%"><span>id</span></th>
<th><span>品牌</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>
</tr>
</thead>
<tbody>
<template v-for="value in lists">
<tr>
<td>{{value.id}}</td>
<td>{{value.brand_name}}</td>
<td>{{value.s_time}}</td>
<td>{{value.e_time}}</td>
<td>{{value.type_name}}</td>
<td>{{value.status_name}}</td>
<td>
<button data-action="/sys/cps/brand/edit_status" data-ajax="post" :data-params-id="value.id"
class="am-btn am-btn-danger am-btn-xs">
{{value.status==1?'禁用':'启用'}}
</button>
<button :data-open="'/sys/cps/brand/get?id='+value.id" class="am-btn am-btn-success am-btn-xs">
修改
</button>
</td>
</tr>
</template>
</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>
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-app',
data: {
params: <?=json_encode($params, JSON_UNESCAPED_UNICODE)?>,
status_lists: <?=json_encode($status_lists, JSON_UNESCAPED_UNICODE)?>,
type_lists: <?=json_encode($type_lists, JSON_UNESCAPED_UNICODE)?>,
lists: <?=json_encode($lists, JSON_UNESCAPED_UNICODE)?>,
},
mounted: function () {
},
methods: {},
watch: {}
});
<?php page_script($pager) ?>
});
</script>
+95
View File
@@ -0,0 +1,95 @@
<div class="coms-table-wrap">
<div class="coms-table-hd clearfix no-border">
<form action="/sys/notice" 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="read" v-model="params.read">
<option value="">全部</option>
<option :value="i" v-for="(v,i) in readList">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-sm am-btn-success w100">搜索</button>
</div>
</div>
</form>
</div>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%">
<label><input type="checkbox" data-check-target=".ids"></label>
<span>ID</span>
</th>
<th width="20%"><span>通知内容</span></th>
<th width="10%"><span>通知时间</span></th>
<th width="8%"><span>状态</span></th>
<th width="8%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td>
<label><input type="checkbox" name="ids[]" class="ids" :value="v.id"/></label>
</td>
<td>
<a v-if="v.url" :data-open="v.url" href="javascript:void(0);">
{{v.content}}
</a>
<span v-else>{{ v.content }}</span>
</td>
<td>{{v.c_time}}</td>
<td>
<span v-if="v.read">{{v.readCn}}</span>
<span v-else style="color:red">{{v.readCn}}</span>
</td>
<td>
<a v-if="v.url" :data-open="v.url" href="javascript:void(0);">查看</a>
</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
<label class="fl mr5"><input type="checkbox" data-check-target=".ids">全选</label>
<div class="am-para-inline w120">
<select data-update-group="" data-list-target=".ids" data-action="/sys/notice/edit_read"
data-field="read">
<option value="">批量操作</option>
<option value="1">标记已读</option>
</select>
</div>
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vue_obj;
var loading = 0;
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: <?=json_encode($params)?>,
lists: <?=json_encode($lists)?>,
readList: <?=json_encode($readList)?>
},
mounted: function () {
},
methods: {},
watch: {}
});
<?php page_script($pager) ?>
});
</script>
+44
View File
@@ -0,0 +1,44 @@
<div class="coms-table-wrap">
<div class="coms-table-hd clearfix no-border">
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/site/callconfig/edit" data-auto="true"
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
<input type="hidden" value="<?= $id ?>" name="id"/>
<div class="am-form-group">
<label class="am-para-label">回呼号码:</label>
<div class="am-para-input w300">
<input type="text" placeholder="输入回呼号码" value="<?= $row['callBackPhoneNo'] ?>"
name="callBackPhoneNo"/>
</div>
<span class="f12 fl clr999 lh-default ml5" style="line-height: 30px;">
客户回拨到号码,为空则回到坐席号码
</span>
</div>
<div class="am-form-group">
<label class="am-para-label label-width">外呼绑定时长:</label>
<div class="col-sm-6" style="padding-left:5px;">
<div class="am-input-group w300">
<input type="number" class="am-form-field" value="<?= $row['callTime'] ?>" placeholder=""
name="callTime">
<a href="javascript:void(0);" class="am-input-group-label">分钟</a>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label label-width">回拨绑定时长:</label>
<div class="col-sm-6" style="padding-left:5px;">
<div class="am-input-group w300">
<input type="number" class="am-form-field" value="<?= $row['callbackTime'] ?>" placeholder=""
name="callbackTime">
<a href="javascript:void(0);" class="am-input-group-label">分钟</a>
</div>
</div>
</div>
<div class="am-form-group">
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">
保存
</button>
</div>
</form>
</div>
</div>
+86
View File
@@ -0,0 +1,86 @@
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/city/city/add" data-auto="true" method="post"
style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto">
<div class="am-form-group">
<label class="am-para-label"><span class="com-must-star">*</span>推送平台:</label>
<div class="am-para-input">
<select name="platform" v-model="info.platform">
<option value="">选择推送平台</option>
<option v-for="(v,i) in platformList" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">
<span class="com-must-star">*</span>推送用户id</label>
<div class="am-para-input">
<input type="text" placeholder="输入用户id" name="uid" v-model="info.uid"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">
<span class="com-must-star">*</span>推送内容:</label>
<div class="am-para-input">
<input type="text" placeholder="输入推送内容" name="content" v-model="info.content"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">
<span class="com-must-star"></span>跳转地址:</label>
<div class="am-para-input">
<input type="text" placeholder="输入跳转地址" name="url" v-model="info.url"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="button" @click="saveEdit">提交</button>
</div>
</div>
<div class="am-modal am-modal-confirm" id="my-confirm">
<div class="am-modal-dialog">
<div class="am-modal-hd">Amaze UI</div>
<div class="am-modal-bd">
你,确定要删除这条记录吗?
</div>
<div class="am-modal-footer">
<span class="am-modal-btn" data-am-modal-cancel>取消</span>
<span class="am-modal-btn" data-am-modal-confirm>确定</span>
</div>
</div>
</div>
</form>
<script>
var loading = 0;
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {
platform: 1,
uid: '',
content: '',
url: ''
},
platformList: <?=json_encode($platformList, JSON_UNESCAPED_UNICODE)?>,
},
mounted: function () {
},
methods: {
saveEdit() {
if (!this.info.uid || !this.info.content) {
layer.msg("参数错误", {icon: 2});
return false
}
$.post('sys/utils/wss/add', this.info, function (response) {
if (response.code == 1) {
layer.msg(response.msg, {'icon': 1})
} else {
layer.msg(response.msg, {'icon': 2});
}
})
}
},
watch: {}
});
});
</script>
+149
View File
@@ -0,0 +1,149 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="coms-table-wrap mt10" id="vue-app">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/sys/vlog/index" id="search_form">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">用户:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input name="user_name" type="text" value="<?= $params['user_name'] ?>"
placeholder="用户" autocomplete="off"/>
</div>
</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 name="type" v-model="type">
<option value="0">所有</option>
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input name="biz_name" type="text" value="<?= $params['biz_name'] ?>"
placeholder="门店" autocomplete="off"/>
</div>
</div>
</div>
<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-create-time" name="c_time" type="text" value="<?= $params['c_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="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="weeks">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month">本月</a>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;">
<div class="am-form-group fl ml30">
<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 table-hover fixed">
<thead>
<tr>
<th width="15%"><span>门店</span></th>
<th width="10%"><span>用户</span></th>
<th width="12%"><span>访问接口</span></th>
<!--
<th width=""><span>访问接口</span></th>
-->
<th width="15%"><span>访问时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(item, index) in lists" :key="item.id">
<tr>
<td style="vertical-align: middle;">{{ item.biz_name }}</td>
<td style="vertical-align: middle;">{{ item.username }}</td>
<td style="vertical-align: middle;">{{ item.title }}</td>
<!--
<td style="vertical-align: middle;overflow: hidden;text-overflow: ellipsis;">{{ item.url }}
</td>
-->
<td style="vertical-align: middle;">{{ item.createTime}}</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<? page_view($pager) ?>
</div>
</div>
</div>
<script>
$(function () {
vue_obj = new Vue({
el: '#vue-app',
data: {
lists: [],
type: <?=$params['type'] ? $params['type'] : 0?>,
typeAry: <?=$typeAry ? json_encode($typeAry) : '[]'?>,
},
mounted: function () {
this.lists = <?= json_encode($lists, JSON_UNESCAPED_UNICODE) ?>;
},
methods: {
// reset() {
//
// }
},
watch: {}
});
<?php page_script($pager) ?>
});
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
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;
$('#id-create-time').val(date);
});
});
</script>
+113
View File
@@ -0,0 +1,113 @@
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/yx/mobile/<?= $url ?>" data-auto="true"
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
<input type="hidden" v-model="row.id" name="id"/>
<div class="am-form-group">
<label class="am-para-label">手机号:</label>
<div class="am-para-input">
<input type="text" placeholder="输入手机号" v-model="row.mobile" name="mobile"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">城市:</label>
<div class="am-form-group am-para-inline w150">
<select name="province_id" v-model="province_id">
<option value="0">省份</option>
<option :value="v.id" v-for="(v,i) in provinceAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="city_id" v-model="city_id">
<option value="0">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存
</button>
</div>
</form>
<script>
vue_obj = new Vue({
el: '#vue-edit',
data: {
row: <?=$row ? json_encode($row, JSON_UNESCAPED_UNICODE) : '[]'?>,
province_id: <?=$row['province_id'] ? $row['province_id'] : 0?>,
city_id: <?=$row['city_id'] ? $row['city_id'] : 0?>,
provinceAry: [],
cityAry: []
},
mounted: function () {
this.init_provinces();
this.init_citys();
},
methods: {
init_provinces: function () {
var vm = this;
$.get('common/area', {}, function (response) {
if (response.code == 1) {
vm.provinceAry = response.data;
}
});
},
init_citys: function () {
var vm = this;
$.get('common/area', {id: vm.province_id, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
}
},
watch: {
'province_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cityAry = [];
that.city_id = '0';
} else {
$.get('common/area', {id: nv, key: 'city', type: 1}, function (response) {
if (response.code == 1) {
that.cityAry = response.data;
if (that.city_id > 0) {
var city_id = '0';
for (var i in that.cityAry) {
var city = that.cityAry[i];
if (city.id == that.city_id) {
city_id = city.id;
break;
}
}
that.city_id = city_id;
}
}
});
}
},
'city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.county_id = '0';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.county_id > 0) {
var county_id = '0';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.county_id) {
county_id = county.id;
break;
}
}
that.county_id = county_id;
}
}
});
}
}
}
});
</script>
+31
View File
@@ -0,0 +1,31 @@
<form id="vue-edit" class="am-form am-form-horizontal" action="/sys/yx/mobile/edit_admin" data-auto="true"
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
<input type="hidden" v-model="row.id" name="id"/>
<div class="am-form-group">
<label class="am-para-label">管理员:</label>
<div class="am-form-group am-para-inline w300">
<select name="admin_id" v-model="row.admin_id">
<option value="0">选择管理员</option>
<option :value="v.id" v-for="(v,i) in adminLists">{{v.username}}({{v.mobile}})</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存
</button>
</div>
</form>
<script>
vue_obj = new Vue({
el: '#vue-edit',
data: {
row: <?=$row ? json_encode($row, JSON_UNESCAPED_UNICODE) : '[]'?>,
adminLists: <?=$adminLists ? json_encode($adminLists, JSON_UNESCAPED_UNICODE) : '[]'?>
},
mounted: function () {
},
methods: {},
watch: {}
});
</script>
+92
View File
@@ -0,0 +1,92 @@
<div class="coms-table-wrap">
<!-- no-border 去掉头部就有边控了-->
<div class="coms-table-hd clearfix no-border">
<form action="/sys/yx/mobile/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 w200">
<input type="text" value="<?= $mobile ?>" name="mobile"/>
</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 fl">
<button type="button" data-modal="/sys/yx/mobile/get" data-title="新增"
class="add 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>
</div>
</form>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="8%"><span>ID</span></th>
<th width="20%"><span>手机号</span></th>
<th width="20%"><span>城市</span></th>
<th width="20%"><span>绑定管理员</span></th>
<th width="8%"><span>状态</span></th>
<th><span>操作</span></th>
</tr>
</thead>
<tbody>
<tr v-for="value in lists">
<!-- <td><input type="checkbox" /></td> -->
<td>{{value.id}}</td>
<td>{{value.mobile}}</td>
<td>{{value.province_name}}-{{value.city_name}}</td>
<td>{{value.admin_name}}</td>
<td>{{ value.status==1 ? '正常': '禁用'}}</td>
<td>
<a v-if="value.status == 1" @click="editStatus(value.id,0)"
class="am-btn am-btn-danger am-btn-xs">禁用</a>
<a v-else @click="editStatus(value.id,1)" class="am-btn am-btn-danger am-btn-xs">启用</a>
<a :data-modal="'/sys/yx/mobile/get?id='+value.id"
class="am-btn am-btn-primary am-btn-xs">修改</a>
<a :data-modal="'/sys/yx/mobile/edit_admin?id='+value.id"
class="am-btn am-btn-primary am-btn-xs">{{value.admin_id>0 ? '修改绑定管理员' :'绑定管理员'}}</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php call_user_func_array('page_view', $this->data['pager']); ?>
</div>
</div>
<script type="text/javascript">
var modal = $('#add-new');
$('.add').on('click', function (e) {
var $target = $(e.target);
modal.modal();
});
var vm = new Vue({
el: '.coms-table-bd',
data: {
lists: JSON.parse('<?=json_encode($this->data['lists'])?>'),
},
methods: {
editStatus: function (index, status) {
$.post('sys/yx/mobile/edit_status', {id: index, status: status}, function (data) {
setTimeout(function () {
if (data.code == '1') {
layer.alert(data.msg, {icon: 1});
window.onhashchange.call();
} else {
layer.alert(data.msg, {icon: 2});
}
}, 500)
})
}
}
})
</script>
+6
View File
@@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+5
View File
@@ -0,0 +1,5 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config = array();
+135
View File
@@ -0,0 +1,135 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database','myResponse');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('comm', 'url', 'array','order','authorization');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array('jwt');
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
+523
View File
@@ -0,0 +1,523 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://market.dev.liche.cn/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/core_classes.html
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'HD_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = COMMPATH.'/vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Allow $_GET array
|--------------------------------------------------------------------------
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 1;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = 'market.ai';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
+112
View File
@@ -0,0 +1,112 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
defined('FILE_READ_MODE') or define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') or define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') or define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') or define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') or define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') or define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') or define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') or define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') or define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') or define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') or define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') or define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') or define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') or define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') or define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') or define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') or define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') or define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') or define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') or define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
define('ERR_SYS_SUCCESS', 0);
define('ERR_SYS_FAIL', 9999);
define('ERR_SYS_INVAL_PARAM', 9998);
define('ERR_USER_NOT_LOGIN', 1001);
/*edit by xuxianbin 这边应该是多写了一个*/
//define('ERR_USER_NOT_LOGIN', 1001);
/*edit end*/
define('ERR_USER_LOGIN_FAIL', 1002);
define('ERR_ACCOUNT_NOT_EXISTS', 1021);
define('ERR_PARAMS_ERROR', 1017);
define('TEMP_PATH', APPPATH . '../www/market/api/');
define('AGENT_H5_URL', 'http://www.auto.haodian.cn/'); //h5域名
//新的api接口code规定
defined('API_CODE_SUCCESS') or define('API_CODE_SUCCESS', 200);//成功
defined('API_CODE_FAIL') or define('API_CODE_FAIL', 400);//请求失败
defined('API_CODE_NONE') or define('API_CODE_FORB', 403);//禁止访问
defined('API_CODE_NONE') or define('API_CODE_NONE', 404);//页面不存在
defined('API_CODE_LOGOUT') or define('API_CODE_LOGOUT', 408);//未登录
defined('API_CODE_INVILD_PARAM') or define('API_CODE_INVILD_PARAM', 401);//非法参数
defined('API_CODE_USER_FULL') or define('API_CODE_USER_FULL', 417);//完善用户资料
defined('API_CODE_ORC_FAIL') or define('API_CODE_ORC_FAIL', 418);//图片识别失败
define('HDY_SMS_SIGN', '好店云'); // 短信签名
+117
View File
@@ -0,0 +1,117 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'mysql:host=127.0.0.1;port=3306;dbname=agentdb',
'username' => 'devuser',
'password' => 'DEV@hdy123456',
'database' => 'agentdb',
'dbdriver' => 'pdo',
'dbprefix' => 'lc_',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
$db['ssdb'] = array(
'dsn' => '',
'hostname' => 'mysql:host=127.0.0.1;port=3306;dbname=ssdb',
'username' => 'devuser',
'password' => 'DEV@hdy123456',
'database' => 'ssdb',
'dbdriver' => 'pdo',
'dbprefix' => 'lc_',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
+24
View File
@@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);
+103
View File
@@ -0,0 +1,103 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);
+20
View File
@@ -0,0 +1,20 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/hooks.html
|
*/
$hook['post_controller_constructor'] = array(
'class' => 'ApiAuthHook',
'function' => 'index',
'filename' => 'ApiAuthHook.php',
'filepath' => 'hooks',
'params' => []
);
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
$config['jwt_key'] = 'yourjwtkey4CITutorial';
$config['jwt_key_pingan'] = 'dvsr23423vsgAEDger';
$config['jwt_key_auto'] = 'zlkEFxfoi7232nAfe';
$config['jwt_algorithm'] = 'HS256';
+19
View File
@@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '192.168.0.16',
'port' => '12001',
'weight' => '1',
),
);
+84
View File
@@ -0,0 +1,84 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';
+184
View File
@@ -0,0 +1,184 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
'odc' => 'application/vnd.oasis.opendocument.chart',
'otc' => 'application/vnd.oasis.opendocument.chart-template',
'odf' => 'application/vnd.oasis.opendocument.formula',
'otf' => 'application/vnd.oasis.opendocument.formula-template',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
'odi' => 'application/vnd.oasis.opendocument.image',
'oti' => 'application/vnd.oasis.opendocument.image-template',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
'odt' => 'application/vnd.oasis.opendocument.text',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oth' => 'application/vnd.oasis.opendocument.text-web'
);
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: linfan
* Date: 2018/11/2
* Time: 14:38
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$config['host'] = '192.168.0.16';
$config['port'] = 27017;
+14
View File
@@ -0,0 +1,14 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/profiling.html
|
*/
+26
View File
@@ -0,0 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['access_key'] = 'Pn60lJXcaOGKvMjn5qv-OMr7wR1lp1p8QG7Ul6NK';
$config['secret_key'] = '83YE_xcHLuejVvbnCiMrMr-CYR7QshBfGgmPSknP';
$config['bucket'] = 'img-liche';
$config['region'] = '华南';
$config['is_https'] = 'https';
$config['domain'] = 'img.liche.cn';
$config['attch'] = 'space/agent';
$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'] = 'img.liche.cn';
$config['img']['attch'] = 'space/agent';
$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'] = 'media.liche.cn';
$config['video']['attch'] = 'space/agent';
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: linfan
* Date: 2018/11/2
* Time: 14:38
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$config['host'] = '127.0.0.1';
$config['port'] = 6679;
+605
View File
@@ -0,0 +1,605 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| HTTP protocol
|--------------------------------------------------------------------------
|
| Set to force the use of HTTPS for REST API calls
|
*/
$config['force_https'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Output Format
|--------------------------------------------------------------------------
|
| The default format of the response
|
| 'array': Array data structure
| 'csv': Comma separated file
| 'json': Uses json_encode(). Note: If a GET query string
| called 'callback' is passed, then jsonp will be returned
| 'html' HTML using the table library in CodeIgniter
| 'php': Uses var_export()
| 'serialized': Uses serialize()
| 'xml': Uses simplexml_load_string()
|
*/
$config['rest_default_format'] = 'json';
/*
|--------------------------------------------------------------------------
| REST Supported Output Formats
|--------------------------------------------------------------------------
|
| The following setting contains a list of the supported/allowed formats.
| You may remove those formats that you don't want to use.
| If the default format $config['rest_default_format'] is missing within
| $config['rest_supported_formats'], it will be added silently during
| REST_Controller initialization.
|
*/
$config['rest_supported_formats'] = [
'json',
'array',
'csv',
'html',
'jsonp',
'php',
'serialized',
'xml',
];
/*
|--------------------------------------------------------------------------
| REST Status Field Name
|--------------------------------------------------------------------------
|
| The field name for the status inside the response
|
*/
$config['rest_status_field_name'] = 'status';
/*
|--------------------------------------------------------------------------
| REST Message Field Name
|--------------------------------------------------------------------------
|
| The field name for the message inside the response
|
*/
$config['rest_message_field_name'] = 'error';
/*
|--------------------------------------------------------------------------
| Enable Emulate Request
|--------------------------------------------------------------------------
|
| Should we enable emulation of the request (e.g. used in Mootools request)
|
*/
$config['enable_emulate_request'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST Realm
|--------------------------------------------------------------------------
|
| Name of the password protected REST API displayed on login dialogs
|
| e.g: My Secret REST API
|
*/
$config['rest_realm'] = 'REST API';
/*
|--------------------------------------------------------------------------
| REST Login
|--------------------------------------------------------------------------
|
| Set to specify the REST API requires to be logged in
|
| FALSE No login required
| 'basic' Unsecured login
| 'digest' More secured login
| 'session' Check for a PHP session variable. See 'auth_source' to set the
| authorization key
|
*/
$config['rest_auth'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Login Source
|--------------------------------------------------------------------------
|
| Is login required and if so, the user store to use
|
| '' Use config based users or wildcard testing
| 'ldap' Use LDAP authentication
| 'library' Use a authentication library
|
| Note: If 'rest_auth' is set to 'session' then change 'auth_source' to the name of the session variable
|
*/
$config['auth_source'] = 'ldap';
/*
|--------------------------------------------------------------------------
| Allow Authentication and API Keys
|--------------------------------------------------------------------------
|
| Where you wish to have Basic, Digest or Session login, but also want to use API Keys (for limiting
| requests etc), set to TRUE;
|
*/
$config['allow_auth_and_keys'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST Login Class and Function
|--------------------------------------------------------------------------
|
| If library authentication is used define the class and function name
|
| The function should accept two parameters: class->function($username, $password)
| In other cases override the function _perform_library_auth in your controller
|
| For digest authentication the library function should return already a stored
| md5(username:restrealm:password) for that username
|
| e.g: md5('admin:REST API:1234') = '1e957ebc35631ab22d5bd6526bd14ea2'
|
*/
$config['auth_library_class'] = '';
$config['auth_library_function'] = '';
/*
|--------------------------------------------------------------------------
| Override auth types for specific class/method
|--------------------------------------------------------------------------
|
| Set specific authentication types for methods within a class (controller)
|
| Set as many config entries as needed. Any methods not set will use the default 'rest_auth' config value.
|
| e.g:
|
| $config['auth_override_class_method']['deals']['view'] = 'none';
| $config['auth_override_class_method']['deals']['insert'] = 'digest';
| $config['auth_override_class_method']['accounts']['user'] = 'basic';
| $config['auth_override_class_method']['dashboard']['*'] = 'none|digest|basic';
|
| Here 'deals', 'accounts' and 'dashboard' are controller names, 'view', 'insert' and 'user' are methods within. An asterisk may also be used to specify an authentication method for an entire classes methods. Ex: $config['auth_override_class_method']['dashboard']['*'] = 'basic'; (NOTE: leave off the '_get' or '_post' from the end of the method name)
| Acceptable values are; 'none', 'digest' and 'basic'.
|
*/
// $config['auth_override_class_method']['deals']['view'] = 'none';
// $config['auth_override_class_method']['deals']['insert'] = 'digest';
// $config['auth_override_class_method']['accounts']['user'] = 'basic';
// $config['auth_override_class_method']['dashboard']['*'] = 'basic';
// ---Uncomment list line for the wildard unit test
// $config['auth_override_class_method']['wildcard_test_cases']['*'] = 'basic';
/*
|--------------------------------------------------------------------------
| Override auth types for specific 'class/method/HTTP method'
|--------------------------------------------------------------------------
|
| example:
|
| $config['auth_override_class_method_http']['deals']['view']['get'] = 'none';
| $config['auth_override_class_method_http']['deals']['insert']['post'] = 'none';
| $config['auth_override_class_method_http']['deals']['*']['options'] = 'none';
*/
// ---Uncomment list line for the wildard unit test
// $config['auth_override_class_method_http']['wildcard_test_cases']['*']['options'] = 'basic';
/*
|--------------------------------------------------------------------------
| REST Login Usernames
|--------------------------------------------------------------------------
|
| Array of usernames and passwords for login, if ldap is configured this is ignored
|
*/
$config['rest_valid_logins'] = ['admin' => '1234'];
/*
|--------------------------------------------------------------------------
| Global IP White-listing
|--------------------------------------------------------------------------
|
| Limit connections to your REST server to White-listed IP addresses
|
| Usage:
| 1. Set to TRUE and select an auth option for extreme security (client's IP
| address must be in white-list and they must also log in)
| 2. Set to TRUE with auth set to FALSE to allow White-listed IPs access with no login
| 3. Set to FALSE but set 'auth_override_class_method' to 'white-list' to
| restrict certain methods to IPs in your white-list
|
*/
$config['rest_ip_whitelist_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Handle Exceptions
|--------------------------------------------------------------------------
|
| Handle exceptions caused by the controller
|
*/
$config['rest_handle_exceptions'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST IP White-list
|--------------------------------------------------------------------------
|
| Limit connections to your REST server with a comma separated
| list of IP addresses
|
| e.g: '123.456.789.0, 987.654.32.1'
|
| 127.0.0.1 and 0.0.0.0 are allowed by default
|
*/
$config['rest_ip_whitelist'] = '';
/*
|--------------------------------------------------------------------------
| Global IP Blacklisting
|--------------------------------------------------------------------------
|
| Prevent connections to the REST server from blacklisted IP addresses
|
| Usage:
| 1. Set to TRUE and add any IP address to 'rest_ip_blacklist'
|
*/
$config['rest_ip_blacklist_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST IP Blacklist
|--------------------------------------------------------------------------
|
| Prevent connections from the following IP addresses
|
| e.g: '123.456.789.0, 987.654.32.1'
|
*/
$config['rest_ip_blacklist'] = '';
/*
|--------------------------------------------------------------------------
| REST Database Group
|--------------------------------------------------------------------------
|
| Connect to a database group for keys, logging, etc. It will only connect
| if you have any of these features enabled
|
*/
$config['rest_database_group'] = 'default';
/*
|--------------------------------------------------------------------------
| REST API Keys Table Name
|--------------------------------------------------------------------------
|
| The table name in your database that stores API keys
|
*/
$config['rest_keys_table'] = 'keys';
/*
|--------------------------------------------------------------------------
| REST Enable Keys
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will look for a column name called 'key'.
| If no key is provided, the request will result in an error. To override the
| column name see 'rest_key_column'
|
| Default table schema:
| CREATE TABLE `keys` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `user_id` INT(11) NOT NULL,
| `key` VARCHAR(40) NOT NULL,
| `level` INT(2) NOT NULL,
| `ignore_limits` TINYINT(1) NOT NULL DEFAULT '0',
| `is_private_key` TINYINT(1) NOT NULL DEFAULT '0',
| `ip_addresses` TEXT NULL DEFAULT NULL,
| `date_created` INT(11) NOT NULL,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
*/
$config['rest_enable_keys'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Table Key Column Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_keys', specify the
| column name to match e.g. my_key
|
*/
$config['rest_key_column'] = 'key';
/*
|--------------------------------------------------------------------------
| REST API Limits method
|--------------------------------------------------------------------------
|
| Specify the method used to limit the API calls
|
| Available methods are :
| $config['rest_limits_method'] = 'IP_ADDRESS'; // Put a limit per ip address
| $config['rest_limits_method'] = 'API_KEY'; // Put a limit per api key
| $config['rest_limits_method'] = 'METHOD_NAME'; // Put a limit on method calls
| $config['rest_limits_method'] = 'ROUTED_URL'; // Put a limit on the routed URL
|
*/
$config['rest_limits_method'] = 'ROUTED_URL';
/*
|--------------------------------------------------------------------------
| REST Key Length
|--------------------------------------------------------------------------
|
| Length of the created keys. Check your default database schema on the
| maximum length allowed
|
| Note: The maximum length is 40
|
*/
$config['rest_key_length'] = 40;
/*
|--------------------------------------------------------------------------
| REST API Key Variable
|--------------------------------------------------------------------------
|
| Custom header to specify the API key
| Note: Custom headers with the X- prefix are deprecated as of
| 2012/06/12. See RFC 6648 specification for more details
|
*/
$config['rest_key_name'] = 'X-API-KEY';
/*
|--------------------------------------------------------------------------
| REST Enable Logging
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will log actions based on the column names 'key', 'date',
| 'time' and 'ip_address'. This is a general rule that can be overridden in the
| $this->method array for each controller
|
| Default table schema:
| CREATE TABLE `logs` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `uri` VARCHAR(255) NOT NULL,
| `method` VARCHAR(6) NOT NULL,
| `params` TEXT DEFAULT NULL,
| `api_key` VARCHAR(40) NOT NULL,
| `ip_address` VARCHAR(45) NOT NULL,
| `time` INT(11) NOT NULL,
| `rtime` FLOAT DEFAULT NULL,
| `authorized` VARCHAR(1) NOT NULL,
| `response_code` smallint(3) DEFAULT '0',
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
*/
$config['rest_enable_logging'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Logs Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_logging', specify the
| table name to match e.g. my_logs
|
*/
$config['rest_logs_table'] = 'logs';
/*
|--------------------------------------------------------------------------
| REST Method Access Control
|--------------------------------------------------------------------------
| When set to TRUE, the REST API will check the access table to see if
| the API key can access that controller. 'rest_enable_keys' must be enabled
| to use this
|
| Default table schema:
| CREATE TABLE `access` (
| `id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
| `key` VARCHAR(40) NOT NULL DEFAULT '',
| `all_access` TINYINT(1) NOT NULL DEFAULT '0',
| `controller` VARCHAR(50) NOT NULL DEFAULT '',
| `date_created` DATETIME DEFAULT NULL,
| `date_modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
*/
$config['rest_enable_access'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Access Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_access', specify the
| table name to match e.g. my_access
|
*/
$config['rest_access_table'] = 'access';
/*
|--------------------------------------------------------------------------
| REST API Param Log Format
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API log parameters will be stored in the database as JSON
| Set to FALSE to log as serialized PHP
|
*/
$config['rest_logs_json_params'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Enable Limits
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will count the number of uses of each method
| by an API key each hour. This is a general rule that can be overridden in the
| $this->method array in each controller
|
| Default table schema:
| CREATE TABLE `limits` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `uri` VARCHAR(255) NOT NULL,
| `count` INT(10) NOT NULL,
| `hour_started` INT(11) NOT NULL,
| `api_key` VARCHAR(40) NOT NULL,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
| To specify the limits within the controller's __construct() method, add per-method
| limits with:
|
| $this->method['METHOD_NAME']['limit'] = [NUM_REQUESTS_PER_HOUR];
|
| See application/controllers/api/example.php for examples
*/
$config['rest_enable_limits'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Limits Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_limits', specify the
| table name to match e.g. my_limits
|
*/
$config['rest_limits_table'] = 'limits';
/*
|--------------------------------------------------------------------------
| REST Ignore HTTP Accept
|--------------------------------------------------------------------------
|
| Set to TRUE to ignore the HTTP Accept and speed up each request a little.
| Only do this if you are using the $this->rest_format or /format/xml in URLs
|
*/
$config['rest_ignore_http_accept'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST AJAX Only
|--------------------------------------------------------------------------
|
| Set to TRUE to allow AJAX requests only. Set to FALSE to accept HTTP requests
|
| Note: If set to TRUE and the request is not AJAX, a 505 response with the
| error message 'Only AJAX requests are accepted.' will be returned.
|
| Hint: This is good for production environments
|
*/
$config['rest_ajax_only'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Language File
|--------------------------------------------------------------------------
|
| Language file to load from the language directory
|
*/
$config['rest_language'] = 'zh';
/*
|--------------------------------------------------------------------------
| CORS Check
|--------------------------------------------------------------------------
|
| Set to TRUE to enable Cross-Origin Resource Sharing (CORS). Useful if you
| are hosting your API on a different domain from the application that
| will access it through a browser
|
*/
$config['check_cors'] = TRUE;
/*
|--------------------------------------------------------------------------
| CORS Allowable Headers
|--------------------------------------------------------------------------
|
| If using CORS checks, set the allowable headers here
|
*/
$config['allowed_cors_headers'] = [
'Origin',
'X-Requested-With',
'Content-Type',
'Accept',
'Access-Control-Request-Method'
];
/*
|--------------------------------------------------------------------------
| CORS Allowable Methods
|--------------------------------------------------------------------------
|
| If using CORS checks, you can set the methods you want to be allowed
|
*/
$config['allowed_cors_methods'] = [
'GET',
'POST',
'OPTIONS',
'PUT',
'PATCH',
'DELETE'
];
/*
|--------------------------------------------------------------------------
| CORS Allow Any Domain
|--------------------------------------------------------------------------
|
| Set to TRUE to enable Cross-Origin Resource Sharing (CORS) from any
| source domain
|
*/
$config['allow_any_cors_domain'] = TRUE;
/*
|--------------------------------------------------------------------------
| CORS Allowable Domains
|--------------------------------------------------------------------------
|
| Used if $config['check_cors'] is set to TRUE and $config['allow_any_cors_domain']
| is set to FALSE. Set all the allowable domains within the array
|
| e.g. $config['allowed_origins'] = ['http://www.example.com', 'https://spa.example.com']
|
*/
$config['allowed_cors_origins'] = [];
+54
View File
@@ -0,0 +1,54 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
+64
View File
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
);
+6
View File
@@ -0,0 +1,6 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['host'] = '192.168.0.16';
$config['port'] = 9512;
$config['SPHINX_MAX_MATCHES'] = '2000';
+214
View File
@@ -0,0 +1,214 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Edge',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot'
);
+9
View File
@@ -0,0 +1,9 @@
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
//服务号-车卖场
$config['default']['appid'] = 'wx42cfb5a705233394';
$config['default']['appSecret'] = 'a34f842ce9ad0f3ec732590e36e15c10';
//测试号
//$config['default']['appid'] = 'wx10561f0e5ea2951f';
//$config['default']['appSecret'] = '25874b9592b5b89f6ca4c3f508aec214';
+12
View File
@@ -0,0 +1,12 @@
<?php
/**
* websocket配置文件
*/
defined('BASEPATH') or exit('No direct script access allowed');
$config['url'] = "wss://sapi.liche.cn/wss";
$config['jwt_key_pingan'] = 'dvsr23423vsgAEDger'; //平安端生成用户秘钥
$config['jwt_key_system'] = '2343ljfwefefew';//后端生成用户秘钥
$config['jwt_algorithm'] = 'HS256';
+203
View File
@@ -0,0 +1,203 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class BaseCommon extends CI_Controller
{
public function __construct()
{
parent::__construct();
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With");
$this->load->model('area_model');
}
/**
* 省市区数据
* @return void
*/
public function regionsData()
{
$req = $this->area_model->getDataByTree();
echo json_encode($req, JSON_UNESCAPED_UNICODE);
}
/**
* 获取品牌
* @return void
*/
public function autoBrand()
{
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->mdAutoBrand->set_db('ssdb');
$where = [
'status>' => -1,
];
$lists = $this->mdAutoBrand->select($where, 'initial asc', 0, 0, 'id,name');
echo json_encode($lists, JSON_UNESCAPED_UNICODE);
}
/**
* 获取车系
* @return void
*/
public function autoSeries()
{
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->mdAutoSeries->set_db('ssdb');
$brandId = intval($this->input->get('brandId'));
$where = [
'status>' => -1,
'brand_id' => $brandId
];
$lists = $this->mdAutoSeries->select($where, 'id asc', 0, 0, 'id,name');
echo json_encode($lists, JSON_UNESCAPED_UNICODE);
}
/**
* 获取车型
* @return void
*/
public function autoCar()
{
$this->load->model('auto/auto_cars_model', 'mdAutoCar');
$this->mdAutoCar->set_db('ssdb');
$seriesId = intval($this->input->get('seriesId'));
$where = [
'status>' => -1,
'series_id' => $seriesId
];
$lists = $this->mdAutoCar->select($where, 'id asc', 0, 0, 'id,name');
echo json_encode($lists, JSON_UNESCAPED_UNICODE);
}
/**
* 获取所有门店
* @return void
*/
public function allBiz()
{
$this->load->model('biz/biz_model');
$this->load->model('biz/biz_car_brand_model');
$this->load->model('agent/auto_product_model');
$this->biz_model->set_db('ssdb');
$this->biz_car_brand_model->set_db('ssdb');
$productId = intval($this->input->get('productId'));
$types = Biz_model::BIZ_TYPE_4s . ',' . Biz_model::BIZ_TYPE_SPACE;
$where = [
'status' => 1,
];
if ($productId) {
$product = $this->auto_product_model->get(['id' => $productId]);
$brandId = $product['brandId'] ?: 0;
$brandBizList = $this->biz_car_brand_model->select(['brand_id' => $brandId], '', '', '', 'biz_id');
$bizIdArray = array_column($brandBizList, 'biz_id');
$bizIdString = $bizIdArray ? implode(',', $bizIdArray) : 0;
$where["(id in ({$bizIdString}) and type=" . Biz_model::BIZ_TYPE_4s . " or type=" . Biz_model::BIZ_TYPE_SPACE . ")"] = null;
} else {
$where["type in ({$types})"] = null;
}
$lists = $this->biz_model->select($where, 'id desc', 0, 0, 'id,biz_name as name,city_id');
echo json_encode($lists, JSON_UNESCAPED_UNICODE);
}
public function autoBrands()
{
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_cars_model', 'mdAutoCar');
$this->mdAutoBrand->set_db('ssdb');
$this->mdAutoSeries->set_db('ssdb');
$this->mdAutoCar->set_db('ssdb');
$redis = load_cache("redis");
$cKey = 'SYS_BRAND_TREE_DATA';
$cacheList = $redis->get($cKey);
if ($cacheList) {
die(json_encode($cacheList, JSON_UNESCAPED_UNICODE));
}
$where = ['status' => 1];
$brandRows = $this->mdAutoBrand->select($where, 'initial asc', 0, 0);
$seriesRows = $this->mdAutoSeries->map('brand_id', '', $where, 'id desc', 0, 0);
$carRows = $this->mdAutoCar->map('series_id', '', $where, 'id desc', 0, 0, 'id as value,name as label,series_id');
$lists = [];
foreach ($brandRows as $brandRow) {
$children = [];
$brand = [
'value' => $brandRow['id'],
'label' => $brandRow['name'],
];
if ($seriesRows[$brandRow['id']]) {
foreach ($seriesRows[$brandRow['id']] as $seriesRow) {
$seriesChildren = $carRows[$seriesRow['id']] ?: [];
$children[] = [
'value' => $seriesRow['id'],
'label' => $seriesRow['name'],
'children' => $seriesChildren
];
}
}
$brand['children'] = $children;
$lists[] = $brand;
}
$redis->save($cKey, $lists, 24 * 60 * 60);
echo json_encode($lists, JSON_UNESCAPED_UNICODE);
}
/**
* 获取所有门店
* @return void
*/
public function allProvinceBiz()
{
$this->load->model('area_model');
$this->load->model('biz/biz_model');
$this->load->model('agent/auto_product_model');
$this->biz_model->set_db('ssdb');
$this->area_model->set_db('ssdb');
$type = Biz_model::BIZ_TYPE_4s;
$where = [
'status' => 1,
'type' => $type
];
$lists = $this->biz_model->map('city_id', '', $where, 'id desc', 0, 0, 'id as value,biz_name as label,city_id');
$provinceTree = $this->area_model->getDataByTree();
$resList = [];
foreach ($provinceTree as $item) {
$children = $item['children'];
$newChildren = [];
foreach ($children as $key => $item2) {
if ($lists[$item2['value']]) {
$item2['children'] = $lists[$item2['value']];
$newChildren[] = $item2;
} else {
$children[$key]['children'] = [];
}
}
if ($newChildren) {
$resList[] = [
'value' => $item['value'],
'label' => $item['label'],
'children' => $newChildren
];
}
}
echo json_encode($resList, JSON_UNESCAPED_UNICODE);
}
/**
* 用户归属中心
* @return void
*/
public function centerList()
{
$this->load->model('agent/pingan/pingan_users_model');
$res = Pingan_users_model::TYPE_CENTER;
echo json_encode($res, JSON_UNESCAPED_UNICODE);
}
public function orgNameList()
{
$this->load->model('agent/pingan/pingan_users_model');
echo json_encode(Pingan_users_model::orgNameList, JSON_UNESCAPED_UNICODE);
}
}
+12
View File
@@ -0,0 +1,12 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/BaseCommon.php';
class Common extends BaseCommon
{
public function __construct()
{
parent::__construct();
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
echo "<h1>agent_admin</h1>";exit;
$this->load->view('welcome_message');
}
public function test()
{
echo '333';
}
}
@@ -0,0 +1,110 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'libraries/REST_Controller.php';
use Restserver\Libraries\REST_Controller;
/**
* Notes:基本控制器
* Created on: 2022/9/2 16:57
* Created by: dengbw
*/
abstract class BaseController extends REST_Controller
{
protected $inputs;
protected $start_time;
const CF2_PRODUCT = 39; //二级来源车型
const CF2_ACTIVITY = 40; //二级来源活动
const APP_ID = 1; //应用id
public function __construct()
{
parent::__construct();
$this->input_param();
$this->start_time = microtime(true);
}
/**
* Notes:获取参数
* Created on: 2022/9/2 16:57
* Created by: dengbw
* @param string $key
* @return mixed
*/
function input_param($key = '')
{
if ($key) {
return $this->inputs[$key];
}
$request = $this->input->method();
switch ($request) {
case 'post':
case 'put':
case 'delete':
$input = json_decode(file_get_contents('php://input'), true);
break;
default:
$input = $this->input->get();
}
$this->inputs = $input;
return $this->inputs;
}
/**
* Notes:返回json
* Created on: 2022/9/8 15:35
* Created by: dengbw
* @param string $message
* @param int $code
*/
public function return_json($message = '', $code = 1)
{
header('Content-Type:application/json; charset=utf-8');
echo json_encode(['code' => $code, 'message' => $message], JSON_UNESCAPED_UNICODE);
exit();
}
/**
* Notes:返回response
* Created on: 2022/9/9 15:39
* Created by: dengbw
* @param array $data
*/
public function return_response_list($data = [])
{
$this->return_response($data, '操作成功', 0, 1);
}
/**
* Notes:返回response
* Created on: 2022/9/8 15:21
* Created by: dengbw
* @param array $data
* @param string $message
* @param int $code
* @param int $if_list
* @param int $http_code
*/
public function return_response($data = [], $message = '操作成功', $code = 0, $if_list = 0, $http_code = REST_Controller::HTTP_OK)
{
$set_data = ['code' => $code, 'message' => $message];
if ($if_list) {//列表显示空数据
$set_data['data'] = $data;
} else {
$data && $set_data['data'] = $data;
}
if ($_SESSION['operation_description']) {//添加操作日志
$this->load->library('api/record');
$method = lcfirst(get_class($this));
$end_time = microtime(true);
$spendTime = ($end_time - $this->start_time) * 1000; //计算差值 毫秒
$this->record->operationRecord(['userId' => $_SESSION['userId'], 'username' => $_SESSION['username']
, 'nickname' => $_SESSION['nickname'], 'method' => $method, 'spendTime' => $spendTime
, 'module' => $_SESSION['operation_module'], 'description' => $_SESSION['operation_description']
, 'params' => json_encode($this->inputs, JSON_UNESCAPED_UNICODE)
, 'result' => json_encode($set_data, JSON_UNESCAPED_UNICODE)]);
}
$this->response($set_data, $http_code, TRUE);
}
}
+43
View File
@@ -0,0 +1,43 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:生成验证码
* Created on: 2022/8/29 17:15
* Created by: dengbw
*/
class Captcha extends BaseController
{
private $redis;
public function __construct()
{
parent::__construct();
$this->redis = &load_cache('redis');
}
public function index_get()
{
$this->load->library('MyCaptcha');
$myCaptcha = new MyCaptcha();
$re = $myCaptcha->create(5, ['width' => 16, 'height' => 20, 'pnum' => 50, 'base64' => 1]);
$code_key = $this->generateSign();
$this->redis->save($code_key, $re['text'], 5 * 60);
$data = ['base64' => $re['base64'], 'code_key' => $code_key];
$this->return_response($data);
}
function generateSign()
{
$sign = md5(mt_rand() . 'mycaptchamarket');
// 拼接上签名作为 Redis 的 key
$key = 'code_' . $sign;
if ($this->redis->exists($key)) {
// 如果生成的 Sign 已存在,就进行递归,直到生成出一个不存在的。
return $this->generateSign();
}
return $key;
}
}
+12
View File
@@ -0,0 +1,12 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/BaseCommon.php';
class Common extends BaseCommon
{
public function __construct()
{
parent::__construct();
}
}
+185
View File
@@ -0,0 +1,185 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:登录操作
* Created on: 2022/8/29 17:15
* Created by: dengbw
*/
class Login extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sys_admin_model', 'mdSysAdmin');
$this->load->model('agent/admin/Market_sys_role_model', 'mdSysRole');
$this->load->model('agent/admin/Market_sys_menu_model', 'mdSysMenu');
$this->load->model('agent/admin/Market_sys_login_record_model', 'mdSysLoginRecord');
}
public function index_get()
{
}
/**
* Notes:用户登录
* Created on: 2022/9/8 14:49
* Created by: dengbw
*/
public function index_post()
{
$username = $this->input_param('username');
$password = $this->input_param('password');
$code = $this->input_param('code');
$code_key = $this->input_param('code_key');
if (!$username) {
$this->return_json('请输入登录账号');
}
if (!$password) {
$this->return_json('请输入登录密码');
}
if (!$code) {
$this->return_json('请输入验证码');
}
$redis = &load_cache('redis');
if (!$redis->get($code_key)) {
$this->return_json('验证码已过期');
}
if ($redis->get($code_key) != $code) {
$this->return_json('验证码错误');
}
$re = $this->mdSysAdmin->get(["username like '{$username}'" => null, 'status' => 0]);
if (!$re) {
$this->return_json('账号不存在');
return;
}
$this->load->library('api/record');
if (!password_verify($password, $re['password'])) {
$message = '密码错误';
$this->record->loginRecord(['userId' => $re['userId'], 'username' => $re['username'], 'nickname' => $re['nickname']
, 'loginType' => 1, 'comments' => $message]);
$this->return_json($message);
}
$user = ['userId' => $re['userId'], 'username' => $re['username'], 'nickname' => $re['nickname']
, 'avatar' => "https://qs.liche.cn/web/images/project/H5-ShiYu/default-avatar.jpg?v=1"
, 'sex' => $re['sex'], 'phone' => $re['phone'], 'introduction' => $re['introduction'], 'email' => $re['email']
, 'enabled' => true, 'accountNonLocked' => true, 'credentialsNonExpired' => true, 'accountNonExpired' => true];
$roles = $authorities = [];
if ($re['roleId']) {
$re_ro = $this->mdSysRole->get(['roleId' => $re['roleId'], 'status' => 0]);
if ($re_ro) {
$re_ro['userId'] = $re['userId'];
$roles[] = $re_ro;
if ($re_ro['menuIds']) {
$authorities = $this->mdSysMenu->select(["menuId in({$re_ro['menuIds']})" => null, 'status' => 0]
, 'sortNumber asc,menuId desc');
foreach ($authorities as $k => $v) {
$authorities[$k]['menuId'] = intval($v['menuId']);
$authorities[$k]['parentId'] = intval($v['parentId']);
$authorities[$k]['menuType'] = intval($v['menuType']);
$authorities[$k]['openType'] = intval($v['openType']);
$authorities[$k]['sortNumber'] = intval($v['sortNumber']);
$authorities[$k]['hide'] = intval($v['hide']);
$authorities[$k]['meta'] = json_decode($v['meta'], true);
}
}
}
}
$user['roles'] = $roles;
$user['authorities'] = $authorities;
$data['access_token'] = generateToken($re['userId']);
$data['user'] = $user;
$this->record->loginRecord(['userId' => $re['userId'], 'username' => $re['username'], 'nickname' => $re['nickname']]);
$redis->delete($code_key);//删除验证码
$this->return_response($data, '登录成功');
}
/**
* Notes:获取手机验证码
* Created on: 2022/10/13 16:54
* Created by: dengbw
*/
public function code_get()
{
$phone = $this->input_param('phone');
if (!$phone) {
$this->return_json('请输入绑定手机号');
}
$re = $this->mdSysAdmin->get(["phone" => $phone, 'status' => 0]);
if (!$re) {
$this->return_json('绑定手机号不存在');
return;
}
$code = rand(100000, 999999);
$redis = &load_cache('redis');
$redis->save($phone, $code, 10 * 60);
//send_sms($phone, $code);
$this->return_response(['code'=>$code], '短信验证码发送成功, 请注意查收!');
}
/**
* Notes:忘记密码
* Created on: 2022/10/13 15:34
* Created by: dengbw
*/
public function forget_post()
{
$phone = $this->input_param('phone');
$password = $this->input_param('password');
$password2 = $this->input_param('password2');
$code = $this->input_param('code');
if (!$phone) {
$this->return_json('请输入绑定手机号');
}
if (!$password) {
$this->return_json('请输入新的登录密码');
}
if (!$password2) {
$this->return_json('请再次输入登录密码');
}
if (mb_strlen($password) < 4) {
$this->return_json('请输入至少4个字符的新密码');
}
if ($password != $password2) {
$this->return_json('两次输入密码不一致');
}
if (!$code) {
$this->return_json('请输入验证码');
}
$redis = &load_cache('redis');
if (!$redis->get($phone)) {
$this->return_json('验证码已过期');
}
if ($redis->get($phone) != $code) {
$this->return_json('验证码错误');
}
$upDate['password'] = password_hash($password, PASSWORD_BCRYPT);
$this->mdSysAdmin->update($upDate, ['phone' => $phone, 'status' => 0]);
$redis->delete($phone);//删除验证码
$this->return_response([], '密码修改成功');
}
/**
* Notes:
* Created on: 2022/8/29 17:06
* Created by: dengbw
* http://market.dev.liche.cn/api/login/test
* http://market.liche.cn/api/login/test
*/
public function test()
{
//echo config('ele_admin.API_KEY');
$mobile = '13860164563';
$signer = new Lcobucci\JWT\Signer\Hmac\Sha256();//加密算法
$time = time();
$key = new Lcobucci\JWT\Signer\Key('market');
$token = (new Lcobucci\JWT\Builder())->issuedBy('http://market.dev.liche.cn')
->identifiedBy('4f1g23a12aa', true)//身份验证
->issuedAt($time)//签发时间
->expiresAt($time + 60)//多长时间以后才能用token,60秒以后才能用
->withClaim('mobile', $mobile)
->getToken($signer, $key);//配置项
echo 'token=' . $token;
}
}
+85
View File
@@ -0,0 +1,85 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:上传图片
* Created on: 2022/9/21 17:15
* Created by: dengbw
*/
class Upload extends BaseController
{
public function __construct()
{
parent::__construct();
}
public function index_post()
{
$file = $_FILES['file'];
if (!$file) {
$this->return_json('请选择图片');
}
if (!$file['tmp_name']) {//太大的图片上传,这个参数会变成空的
$this->return_json('参数错误');
}
if (!file_exists(TEMP_PATH)) {
$oldumask = umask(0);
mkdir(TEMP_PATH, 0777, true);
umask($oldumask);
}
$tmp = TEMP_PATH . md5($file['name'] . uniqid()) . substr($file['name'], strpos($file['name'], '.', strlen($file['name']) - 1));
move_uploaded_file($file['tmp_name'], $tmp);
if (!filesize($tmp)) {
$this->return_json('图片有点问题,换个小的试试');
}
//上传图片到FTP
$res = $this->upload_img_qiniu($tmp, "admin/");
if (!$res) {
$this->return_json('上传失败');
}
$data['full_url'] = build_qiniu_image_url($res['photo']);
$data['url'] = $res['photo'];
$this->return_response($data);
}
/**
* @param string $file 上传的文件
* @param string $path 要保存的目录
* @param string $filename 原始文件名称
* @return array
* @throws Exception
*/
private function upload_img_qiniu($file, $path = '', $filename = '')
{
$phoId = md5(uniqid() . mt_rand(0, 10000) . time());
$filename = $filename ? $filename : $file;
$ext_arr = explode(".", $filename);
$ext = count($ext_arr) > 1 ? $ext_arr[count($ext_arr) - 1] : 'jpg';
if (is_uploaded_file($file)) {
//上传图片
$oriPath = TEMP_PATH . '/p_' . $phoId . '_ori.' . $ext;
move_uploaded_file($file, $oriPath);
} else {
$oriPath = $file;
}
$oriKey = 'p_' . $phoId . '.' . $ext;
// 上传到七牛后保存的文件名
$photo = $path . date('Ym') . "/" . $oriKey;
//上传图片到FTP
$this->load->library('qiniu');
$res = $this->qiniu->save($photo, file_get_contents($oriPath));
$img_size = getimagesize($oriPath);
$file_size = filesize($oriPath);
$size = "{$img_size[0]},{$img_size[1]},{$file_size}";
unlink($oriPath);
if ($res) {
$size = getimagesize($res['url']);
return array('photo' => $res['file'], 'size' => $size);
} else {
return array();
}
}
}
@@ -0,0 +1,52 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:修改密码
* Created on: 2022/9/05 17:15
* Created by: dengbw
*/
class Password extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sys_admin_model', 'mdSysAdmin');
}
/**
* Notes:修改密码
* Created on: 2022/9/16 11:11
* Created by: dengbw
*/
public function index_put()
{
$oldPassword = $this->input_param('oldPassword');
$password = $this->input_param('password');
$password2 = $this->input_param('password2');
if (!$oldPassword) {
$this->return_json('请输入旧密码');
}
if (!$password) {
$this->return_json('请输入新密码');
}
if (!$password2) {
$this->return_json('请再次输入新密码');
}
if (mb_strlen($password) < 4) {
$this->return_json('请输入至少4个字符的新密码');
}
if ($password != $password2) {
$this->return_json('两次输入密码不一致');
}
if (!password_verify($oldPassword, $_SESSION['password'])) {
$this->return_json('旧密码错误');
}
$upDate['password'] = password_hash($password, PASSWORD_BCRYPT);
$this->mdSysAdmin->update($upDate, ['userId' => $_SESSION['userId']]);
$this->return_response();
}
}
+53
View File
@@ -0,0 +1,53 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:获取用户信息
* Created on: 2022/9/05 17:15
* Created by: dengbw
*/
class User extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sys_role_model', 'mdSysRole');
$this->load->model('agent/admin/Market_sys_menu_model', 'mdSysMenu');
}
public function index_get()
{
$re = $_SESSION;
$user = ['userId' => $re['userId'], 'username' => $re['username'], 'nickname' => $re['nickname']
, 'avatar' => "https://qs.liche.cn/web/images/project/H5-ShiYu/default-avatar.jpg?v=1"
, 'sex' => $re['sex'], 'phone' => $re['phone'], 'introduction' => $re['introduction'], 'email' => $re['email']
, 'enabled' => true, 'accountNonLocked' => true, 'credentialsNonExpired' => true, 'accountNonExpired' => true];
$roles = $authorities = [];
if ($re['roleId']) {
$re_ro = $this->mdSysRole->get(['roleId' => $re['roleId'], 'status' => 0]);
if ($re_ro) {
$re_ro['userId'] = $re['userId'];
$roles[] = $re_ro;
if ($re_ro['menuIds']) {
$authorities = $this->mdSysMenu->select(["menuId in({$re_ro['menuIds']})" => null, 'status' => 0]
, 'sortNumber asc,menuId desc');
foreach ($authorities as $k => $v) {
$authorities[$k]['menuId'] = intval($v['menuId']);
$authorities[$k]['parentId'] = intval($v['parentId']);
$authorities[$k]['menuType'] = intval($v['menuType']);
$authorities[$k]['openType'] = intval($v['openType']);
$authorities[$k]['sortNumber'] = intval($v['sortNumber']);
$authorities[$k]['hide'] = intval($v['hide']);
$authorities[$k]['meta'] = json_decode($v['meta'], true);
}
}
}
}
$user['roles'] = $roles;
$user['authorities'] = $authorities;
$this->return_response($user);
}
}
+212
View File
@@ -0,0 +1,212 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
class Product extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/auto_product_model', 'autoProduct');
$this->load->helper('image');
$this->load->model('area_model');
}
public function page_get()
{
$params = $this->input_param();
$page = $this->input_param('page');
$limit = $this->input_param('limit');
$title = $this->input_param('title');
$sort = $this->input_param('sort');
$order = $this->input_param('order');
!$page && $page = 1;
!$limit && $limit = 10;
$sort_order = 'id desc';
if ($sort && $order) {
$sort_order = $sort . ' ' . $order;
}
$list = [];
$where = ['status>=' => 0];
$selectedCar = json_decode($params['selectedCar'], true) ?: [];
$title && $where['title LIKE "%' . trim($title) . '%"'] = null;
$selectedCar['brandId'] && $where['brandId'] = $selectedCar['brandId'];
$selectedCar['seriesId'] && $where['seriesId'] = $selectedCar['seriesId'];
if (strlen($params['status'])) {
$where['status'] = intval($params['status']);
}
if ($params['dateRange'][0] && $params['dateRange'][1]) {
$where['timeLaunch>='] = $params['dateRange'][0] . ' 00:00:00';
$where['timeLaunch<='] = $params['dateRange'][1] . ' 23:59:59';
}
$labelIdArray = [];
$params['priceRange'] && $labelIdArray = array_merge($labelIdArray, $params['priceRange']);
$params['carProductLabel'] && $labelIdArray = array_merge($labelIdArray, $params['carProductLabel']);
$params['productLevel'] && $labelIdArray = array_merge($labelIdArray, $params['productLevel']);
if ($labelIdArray) {
$countLabelIds = count($labelIdArray);
$labelIdString = implode(',', $labelIdArray);
$where["lc_auto_product.id in (SELECT product_id
FROM lc_auto_product_label
WHERE label_id IN ($labelIdString)
GROUP BY product_id
HAVING COUNT(DISTINCT label_id) = $countLabelIds)"] = null;
}
if ($params['citys']) {
$cityArray = [];
foreach ($params['citys'] as $item) {
$temp = json_decode($item, true);
$temp && $cityArray[] = $temp[1];
}
$cityIds = implode(',', $cityArray);
$cityIds && $where["cityId in ($cityIds)"] = null;
}
$count = $this->autoProduct->selectProductCount($where);
if ($count) {
$res = $this->autoProduct->selectProduct($where, $sort_order, $page, $limit, '', 'AutoProductEntity');
/** @var AutoProductEntity[] $res */
foreach ($res as $v) {
$temp = (array)$v;
$getProvinceCity = $v->getProvinceCity();
$temp['banner'] = $v->banner ? changeImg(explode(',', $v->banner)) : [];
$temp['posterBg'] = $v->posterBg ? changeImg(explode(',', $v->posterBg)) : [];
$temp['timeLaunch'] = $v->timeLaunch != '0000-00-00 00:00:00' ? $v->timeLaunch : "";
$temp['imgs'] = $v->imgs ? changeImg(explode(',', $v->imgs)) : [];
$temp['dateRange'] = [$v->timeStart, $v->timeEnd];
$temp['provinceCity'] = $getProvinceCity['provinceCityIds'] ?: [];
$temp['cityName'] = $getProvinceCity['cityNames'] ?: ['全国'];
$temp['status'] = intval($v->status);
$temp['crowdProfiling'] = json_decode($v->crowdProfiling) ? json_decode($v->crowdProfiling) : [];
$temp['selectedCar'] = [
'brandId' => $v->brandId ?: '',
'seriesId' => $v->seriesId ?: '',
'modelId' => ''
];
$temp['promotion_text'] = json_decode($v->promotion_text, true) ?: [];
$temp['carProductLabel'] = $v->getLabel();
$temp['labels'] = $v->getLabel();
$list[] = $temp;
}
}
$data = ['list' => $list, 'count' => $count];
$this->return_response_list($data);
}
public function index_post()
{
$params = $this->input_param();
$res = $this->autoProduct->saveOrUpdate($params);
if (!$res) {
$this->return_json('添加失败');
}
$this->return_response();
}
public function index_put()
{
$params = $this->input_param();
if (!$this->autoProduct->get(['id' => $params['id']])) {
$this->return_json('数据不存在');
}
$res = $this->autoProduct->saveOrUpdate($params);
if (!$res) {
$this->return_json('更新失败');
}
$this->return_response();
}
/**
* 修改状态
*/
public function status_put()
{
$id = $this->input_param('id');
$status = $this->input_param('status');
/** @var AutoProductEntity $row */
$row = $this->autoProduct->get(['id' => $id], '', 'AutoProductEntity');
if (!$row) {
$this->return_json('参数错误');
}
if (!$row->banner) {
$this->return_json('产品缩略图未上传');
}
if (!$row->imgs) {
$this->return_json('产品轮播图未上传');
}
$update = [
'status' => $status,
];
if ($update['status']) {
$update['timeLaunch'] = date('Y-m-d H:i:s');
}
$this->autoProduct->update($update, ['id' => $id]);
$this->return_response();
}
/**
* 删除
*/
public function index_delete()
{
$ids = $this->input_param('ids');
if (!$ids) {
$this->return_json('参数错误');
}
$str_ids = is_array($ids) ? implode(',', $ids) : $ids;
if ($str_ids) {
$this->autoProduct->update(['status' => -1], ["id in($str_ids)" => null]);
}
$this->return_response();
}
/**
* 修改佣金
*/
public function brokerage_put()
{
$params = $this->input_param();
if (!$this->autoProduct->get(['id' => $params['id']])) {
$this->return_json('参数错误');
}
$update = [
'cluesCommission' => $params['cluesCommission'] ?: 0,
'orderCommission' => $params['orderCommission'] ?: 0,
];
$this->autoProduct->update($update, ['id' => $params['id']]);
$this->return_response();
}
/**
* 修改CPS金额
*/
public function cps_put()
{
$params = $this->input_param();
if (!$this->autoProduct->get(['id' => $params['id']])) {
$this->return_json('参数错误');
}
$update = [
'cpsMoney' => $params['cpsMoney'] ?: 0,
];
$this->autoProduct->update($update, ['id' => $params['id']]);
$this->return_response();
}
/**
* 修改状态
*/
public function sort_put()
{
$id = $this->input_param('id');
$sort = $this->input_param('sort');
if (!$this->autoProduct->get(['id' => $id])) {
$this->return_json('参数错误');
}
$update = [
'sort' => intval($sort),
];
$this->autoProduct->update($update, ['id' => $id]);
$this->return_response([], '保存成功');
}
}
@@ -0,0 +1,105 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
class ProductCoupon extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/auto_product_coupon_model', 'autoProductCoupon');
$this->load->helper('image');
$this->load->model('area_model');
}
public function page_get()
{
$params = $this->input_param();
$page = $this->input_param('page');
$limit = $this->input_param('limit');
$title = $this->input_param('title');
!$page && $page = 1;
!$limit && $limit = 10;
$sort_order = 'id desc';
$list = [];
$where = ['status>=' => 0, 'product_id' => $params['productId']];
$title && $where['title LIKE "%' . trim($title) . '%"'] = null;
$count = $this->autoProductCoupon->count($where);
if ($count) {
$res = $this->autoProductCoupon->select($where, $sort_order, $page, $limit, '', 'AutoProductCouponEntity');
/** @var AutoProductCouponEntity[] $res */
foreach ($res as $v) {
$temp = (array)$v;
$temp['status'] = intval($v->status);
$temp['dateRange'] = [$v->timeStart, $v->timeEnd];
$temp['userType'] = intval($v->userType) ?: 0;
$temp['bizs'] = $v->getBizs();
$temp['selectBiz'] = $v->getShowBiz($temp['bizs']);
$temp['typeCn'] = $v->getTypeCn();
$list[] = $temp;
}
}
$data = ['list' => $list, 'count' => $count];
$this->return_response_list($data);
}
public function index_post()
{
$params = $this->input_param();
if (!$params['productId']) {
$this->return_json('参数错误');
}
$res = $this->autoProductCoupon->saveOrUpdate($params);
if (!$res) {
$this->return_json('添加失败');
}
$this->return_response();
}
public function index_put()
{
$params = $this->input_param();
if (!$this->autoProductCoupon->get(['id' => $params['id']])) {
$this->return_json('数据不存在');
}
$res = $this->autoProductCoupon->saveOrUpdate($params);
if (!$res) {
$this->return_json('更新失败');
}
$this->return_response();
}
/**
* 修改状态
*/
public function status_put()
{
$id = $this->input_param('id');
$status = $this->input_param('status');
if (!$this->autoProductCoupon->get(['id' => $id])) {
$this->return_json('参数错误');
}
$update = [
'status' => $status,
];
$this->autoProductCoupon->update($update, ['id' => $id]);
$this->return_response();
}
/**
* 删除
*/
public function index_delete()
{
$ids = $this->input_param('ids');
if (!$ids) {
$this->return_json('参数错误');
}
$str_ids = is_array($ids) ? implode(',', $ids) : $ids;
if ($str_ids) {
$this->autoProductCoupon->update(['status' => -1], ["id in($str_ids)" => null]);
}
$this->return_response();
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
class Data extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_clues_model', 'clues_model');
$this->clues_model->set_db('ssdb');
$this->load->model('agent/pingan/pingan_users_model');
$this->load->model('receiver/order/receiver_orders_model');
$this->receiver_orders_model->set_db('ssdb');
}
public function index_get()
{
$where = [
'app_id' => self::APP_ID
];
$total_clues = $this->clues_model->count($where);
$where['c_time>='] = strtotime(date('Y-m-d 00:00:00'));
$where['c_time<='] = time();
$today_clues = $this->clues_model->count($where);
$member = $this->pingan_users_model->count(['status' => Pingan_users_model::STATUS_NORMAL]);
$app_id = self::APP_ID;
$where = [
"clue_id in (select id from lc_receiver_clues where app_id={$app_id})" => null
];
$orders = $this->receiver_orders_model->count($where);
$data = [
'total_clues' => $total_clues,
'today_clues' => $today_clues,
'member' => $member,
'orders' => $orders
];
$this->return_response($data);
}
}
@@ -0,0 +1,255 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:私域直播_机构管理
* Created on: 2022/9/16 17:15
* Created by: dengbw
*/
class Organization extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sylive_organization_model', 'mdSyliveOrganization');
}
/**
* Notes:获取机构
* Created on: 2022/9/16 11:11
* Created by: dengbw
*/
public function index_get()
{
$unOrganizationType = intval($this->input_param('unOrganizationType'));
$activityId = intval($this->input_param('activityId'));
$where['status>='] = 0;
$unOrganizationType && $where['organizationType<>'] = $unOrganizationType;
$sort_order = 'sortNumber asc,organizationId desc';
if ($_SESSION['brandName'] || $activityId) {//只找该品牌机构
if ($activityId) {
$this->load->model('agent/admin/Market_sylive_activity_model', 'mdSyliveActivity');
$re_act = $this->mdSyliveActivity->get(['activityId' => $activityId]);
$re_org['organizationId'] = intval($re_act['organizationId']);
} else {
$re_org = $this->mdSyliveOrganization->get(['organizationName' => $_SESSION['brandName'], 'parentId' => 0, 'status' => 0]);
}
if ($re_org['organizationId']) {
$organizationIds[] = $re_org['organizationId'];
$res_all = $this->mdSyliveOrganization->select($where, 'organizationType asc,parentId asc', 0, 0, 'organizationId,parentId');
foreach ($res_all as $k => $v) {
if (in_array($v['parentId'], $organizationIds)) {
$organizationIds[] = $v['organizationId'];
}
}
$str_organizationIds = implode(',', array_unique($organizationIds));
$where["organizationId in({$str_organizationIds})"] = null;
} else {
$where['organizationId'] = -1;
}
}
$res = $this->mdSyliveOrganization->select($where, $sort_order);
foreach ($res as $k => $v) {
$res[$k]['organizationId'] = intval($v['organizationId']);
$res[$k]['parentId'] = intval($v['parentId']);
$res[$k]['sortNumber'] = intval($v['sortNumber']);
$city = $logo = [];
if ($v['countyId']) {
$city[] = $v['provinceId'];
$city[] = $v['cityId'];
$city[] = $v['countyId'];
}
$res[$k]['city'] = $city;
if ($v['logo']) {
$logo[] = ['uid' => 1, 'fileUrl' => $v['logo'], 'url' => build_qiniu_image_url($v['logo']), 'status' => 'done'];
}
$res[$k]['logo'] = $logo;
}
$this->return_response_list($res);
}
/**
* Notes:查找上级机构
* Created on: 2022/10/24 15:24
* Created by: dengbw
*/
public function parent_get()
{
$list = [];
if ($_SESSION['brandName']) {//只找该品牌机构
$re_org = $this->mdSyliveOrganization->get(['organizationName' => $_SESSION['brandName'], 'parentId' => 0, 'status>=' => 0]);
if ($re_org['organizationId']) {
$list[] = ['organizationId' => intval($re_org['organizationId']), 'organizationName' => $re_org['organizationName']];
}
} else {
$parentId = intval($this->input_param('parentId'));
$sort_order = 'sortNumber asc,organizationId desc';
$where['status>='] = 0;
$where['parentId'] = $parentId;
$res = $this->mdSyliveOrganization->select($where, $sort_order, 0, 0, 'organizationId,organizationName');
foreach ($res as $k => $v) {
$list[] = ['organizationId' => intval($v['organizationId']), 'organizationName' => $v['organizationName']];
}
}
$this->return_response_list($list);
}
/**
* Notes:添加机构
* Created on: 2022/9/19 16:43
* Created by: dengbw
*/
public function index_post()
{
$parentId = intval($this->input_param('parentId'));
$organizationName = $this->input_param('organizationName');
$organizationFullName = $this->input_param('organizationFullName');
$organizationType = $this->input_param('organizationType');
$sortNumber = intval($this->input_param('sortNumber'));
$comments = $this->input_param('comments');
$city = $this->input_param('city');
$logo = $this->input_param('logo');
$enrollDeal = $this->input_param('organization');
if ($_SESSION['brandName'] && !$parentId) {//品牌机构必顺选择上级机构
$this->return_json('请选择上级机构');
}
if (!$organizationName) {
$this->return_json('请输入机构名称');
}
if (!$organizationType) {
$this->return_json('请选择机构类型');
}
if ($parentId) {//判断上级机构是不是员工类型
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $parentId]);
if ($re_org['organizationType'] == 4) {
$this->return_json('选择的上级机构不能保存,请重新选择');
}
}
!$comments && $comments = '';
$logo = $logo[0]['fileUrl'] ? $logo[0]['fileUrl'] : '';
$addDate = ['parentId' => $parentId, 'organizationName' => $organizationName, 'organizationFullName' => $organizationFullName
, 'organizationType' => $organizationType, 'sortNumber' => $sortNumber, 'comments' => $comments, 'logo' => $logo
, 'createTime' => date('Y-m-d H:i:s')];
if ($city) {
$addDate['provinceId'] = intval($city[0]);
$addDate['cityId'] = intval($city[1]);
$addDate['countyId'] = intval($city[2]);
}
if($enrollDeal){
$addDate['enrollDeal'] = $enrollDeal;
}
$id = $this->mdSyliveOrganization->add($addDate);
if (!$id) {
$this->return_json('添加机构失败');
}
$this->return_response();
}
/**
* Notes:修改机构
* Created on: 2022/9/19 17:29
* Created by: dengbw
*/
public function index_put()
{
$organizationId = intval($this->input_param('organizationId'));
$parentId = intval($this->input_param('parentId'));
$organizationName = $this->input_param('organizationName');
$organizationFullName = $this->input_param('organizationFullName');
$organizationType = $this->input_param('organizationType');
$sortNumber = intval($this->input_param('sortNumber'));
$comments = $this->input_param('comments');
$city = $this->input_param('city');
$logo = $this->input_param('logo');
$enrollDeal = $this->input_param('enrollDeal');
if ($_SESSION['brandName']) {//品牌机构
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
if ($re_org && $re_org['parentId'] == 0) {//一级品牌不可修改字段
$parentId = 0;
$organizationType = 1;
$organizationName = $re_org['organizationName'];
}
}
if (!$organizationId) {
$this->return_json('参数错误');
}
if (!$organizationName) {
$this->return_json('请输入机构名称');
}
if (!$organizationType) {
$this->return_json('请选择机构类型');
}
if ($parentId) {//判断上级机构是不是员工类型
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $parentId]);
if ($re_org['organizationType'] == 4) {
$this->return_json('选择的上级机构不能保存,请重新选择');
}
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$upDate = ['parentId' => $parentId, 'organizationName' => $organizationName, 'organizationFullName' => $organizationFullName
, 'organizationType' => $organizationType, 'sortNumber' => $sortNumber, 'comments' => $comments, 'logo' => $logo];
if ($city) {
$upDate['provinceId'] = intval($city[0]);
$upDate['cityId'] = intval($city[1]);
$upDate['countyId'] = intval($city[2]);
}
if($enrollDeal){
$upDate['enrollDeal'] = $enrollDeal;
}
$this->mdSyliveOrganization->update($upDate, ['organizationId' => $organizationId]);
$this->return_response();
}
/**
* Notes:删除机构
* Created on: 2022/9/19 11:08
* Created by: dengbw
* @param null $organizationId
*/
public function index_delete($organizationId = null)
{
$organizationId = intval($organizationId);
if (!$organizationId) {
$this->return_json('参数错误');
}
$this->mdSyliveOrganization->update(['status' => -1], ['organizationId' => $organizationId]);
$this->return_response();
}
/**
* Notes:批量删除机构
* Created on: 2022/9/8 17:11
* Created by: dengbw
*/
public function batch_delete()
{
$ids = $this->input_param('ids');
if (!$ids) {
$this->return_json('参数错误');
}
$str_ids = implode(',', $ids);
if ($str_ids) {
$this->mdSyliveOrganization->update(['status' => -1], ["organizationId in($str_ids)" => null]);
}
$this->return_response();
}
/**
* Notes:机构详情
* Created on: 2022/12/09 10:37
* Created by: dengbw
*/
public function info_get()
{
$organizationId = intval($this->input_param('organizationId'));
if (!$organizationId) {
$this->return_json('参数错误');
}
$re = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
$this->return_response($re);
}
}
@@ -0,0 +1,325 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:私域直播_机构用户管理
* Created on: 2022/9/19 17:15
* Created by: dengbw
*/
class OrganizationUser extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sylive_user_model', 'mdSyliveUser');
$this->load->model('agent/admin/Market_sylive_organization_model', 'mdSyliveOrganization');
}
/**
* Notes:用户管理列表
* Created on: 2022/9/20 14:48
* Created by: dengbw
*/
public function page_get()
{
$page = $this->input_param('page');
$limit = $this->input_param('limit');
$uname = $this->input_param('uname');
$nickname = $this->input_param('nickname');
$sort = $this->input_param('sort');
$order = $this->input_param('order');
$organizationId = intval($this->input_param('organizationId'));
!$page && $page = 1;
!$limit && $limit = 10;
$sort_order = 'userId desc';
if ($sort && $order) {
$sort_order = $sort . ' ' . $order;
}
$list = [];
$where['status>='] = 0;
$organizationId && $where['organizationId'] = $organizationId;
$uname && $where['uname'] = $uname;
$nickname && $where['nickname'] = $nickname;
$this->load->model('agent/admin/Market_sylive_organization_model', 'mdSyliveOrganization');
$organizationType = 0;
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
$re_org && $organizationType = $re_org['organizationType'];
$roleName = $this->mdSyliveUser->roleAry($organizationType);
$count = $this->mdSyliveUser->count($where);
if ($count) {
$res = $this->mdSyliveUser->select($where, $sort_order, $page, $limit);
foreach ($res as $v) {
$status = intval($v['status']);
$createTime = $v['createTime'] != '0000-00-00 00:00:00' ? $v['createTime'] : '';
$list[] = [
'userId' => $v['userId'], 'uname' => $v['uname'], 'nickname' => $v['nickname'], 'mobile' => $v['mobile']
, 'roleName' => $roleName, 'organizationId' => $organizationId, 'status' => $status, 'createTime' => $createTime];
}
}
$date = ['list' => $list, 'count' => $count];
$this->return_response_list($date);
}
/**
* Notes:获取机构用户
* Created on: 2022/11/29 11:08
* Created by: dengbw
*/
public function list_post()
{
$this->load->model('agent/admin/Market_sylive_groups_user_model', 'mdSyliveGroupsUser');
$this->load->model('agent/admin/Market_sylive_groups_model', 'mdSyliveGroups');
$activityId = intval($this->input_param('activityId'));
$organizationIds = $this->input_param('organizationIds');
$keyword = trim($this->input_param('keyword'));
$where = ['status>=' => 0, 'organizationId>' => 0];
if ($keyword) {
$this->load->model('agent/admin/Market_sylive_activity_model', 'mdSyliveActivity');
$where["(uname LIKE '%{$keyword}%' OR mobile LIKE '%{$keyword}%')"] = null;
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
if ($re['organizationId']) {//找当前顶级机构用户
$where["topOrgId"] = $re['organizationId'];
}
} else if ($organizationIds) {
$organizationIds = implode(',', $organizationIds);
$where["organizationId in({$organizationIds}) or bizId in({$organizationIds})"] = null;
}
$res = $this->mdSyliveUser->select($where, 'userId desc', 0, 0, 'userId,uname,mobile,organizationId,bizId');
if ($keyword && $res) {
$organizationIds = [];
foreach ($res as $v) {
$v['bizId'] && $organizationIds[] = $v['bizId'];
$v['organizationId'] && $organizationIds[] = $v['organizationId'];
}
$organizationIds && $organizationIds = implode(',', $organizationIds);
}
$map_organization = [];
if ($organizationIds) {
$map_organization = $this->mdSyliveOrganization->map('organizationId', 'organizationName,organizationType'
, ["organizationId in({$organizationIds})" => null]);
}
$list = [];
foreach ($res as $v) {
$uname = $v['uname'] ? $v['uname'] : '-';
$organization = $map_organization[$v['bizId']];
if (!$organization) {
$organization = $map_organization[$v['organizationId']];
}
$organizationName = $organization['organizationName'] ? $organization['organizationName'] : '-';
$type = 2;
if ($v['bizId']) {
$type = $v['bizId'] == $v['organizationId'] ? 1 : 0;
}
$groups = 0;
$re_gro_use = $this->mdSyliveGroupsUser->get(['activityId' => $activityId, 'userId' => $v['userId']
, 'status>=' => 0], 'groupsId,bizId');
if ($re_gro_use) {
$groups = 1;
$groupsId = $re_gro_use['bizId'] ? $re_gro_use['bizId'] : $re_gro_use['groupsId'];
$re_gro = $this->mdSyliveGroups->get(['activityId' => $activityId, 'groupsId' => $groupsId
, 'status>=' => 0], 'groupsName');
$re_gro['groupsName'] && $organizationName .= "(分组-{$re_gro['groupsName']})";
}
$list[] = ['userId' => $v['userId'], 'uname' => $uname, 'mobile' => $v['mobile'], 'type' => $type
, 'groups' => $groups, 'organizationName' => $organizationName];
}
$this->return_response_list($list);
}
/**
* Notes:添加用户
* Created on: 2022/9/21 16:46
* Created by: dengbw
*/
public function index_post()
{
$mobile = $this->input_param('mobile');
$organizationId = intval($this->input_param('organizationId'));
$uname = $this->input_param('uname');
if (!$mobile) {
$this->return_json('请输入手机号');
}
if (!$organizationId) {
$this->return_json('请选择所属机构');
}
if (!$uname) {
$this->return_json('请输入姓名');
}
$topOrgId = $this->getTopOrgId($organizationId);
$re = $this->mdSyliveUser->get(['mobile' => $mobile, 'topOrgId' => $topOrgId]);
if ($re && $re['status'] != -1) {
if ($re['teamId'] || $re['organizationId']) {
$this->return_json('手机号已存在当前机构');
}
}
$bizId = 0;
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
if ($re_org) {
if ($re_org['organizationType'] == 4 && $re_org['parentId']) {
$bizId = $re_org['parentId'];
} else if ($re_org['organizationType'] == 3) {
$bizId = $re_org['organizationId'];
}
}
$addDate = ['topOrgId' => $topOrgId, 'organizationId' => $organizationId, 'uname' => $uname,
'bizId' => $bizId, 'status' => 0, 'teamId' => 0];
if ($re && $re['status'] != -1) {
$this->mdSyliveUser->update($addDate, ['userId' => $re['userId']]);
$this->return_response([], '绑定用户成功');
} else {
$addDate['mobile'] = $mobile;
$addDate['createTime'] = date('Y-m-d H:i:s');
$id = $this->mdSyliveUser->add($addDate);
if (!$id) {
$this->return_json('添加用户失败');
}
$this->return_response();
}
}
/**
* Notes:修改用户
* Created on: 2022/9/21 14:48
* Created by: dengbw
*/
public function index_put()
{
$userId = intval($this->input_param('userId'));
$organizationId = intval($this->input_param('organizationId'));
$uname = $this->input_param('uname');
if (!$userId) {
$this->return_json('参数错误');
}
if (!$organizationId) {
$this->return_json('请选择所属机构');
}
if (!$uname) {
$this->return_json('请输入姓名');
}
$re = $this->mdSyliveUser->get(['userId' => $userId]);
if (!$re) {
$this->return_json('无此用户');
}
$topOrgId = $re['topOrgId'];
if ($re['organizationId'] != $organizationId) {
$topOrgId = $this->getTopOrgId($organizationId);
if ($re['topOrgId'] && $re['topOrgId'] != $topOrgId) {
$this->return_json('不可修改顶级机构');
}
}
$bizId = 0;
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
if ($re_org) {
if ($re_org['organizationType'] == 4 && $re_org['parentId']) {
$bizId = $re_org['parentId'];
} else if ($re_org['organizationType'] == 3) {
$bizId = $re_org['organizationId'];
}
}
$upDate = ['topOrgId' => $topOrgId, 'organizationId' => $organizationId, 'bizId' => $bizId, 'teamId' => 0, 'uname' => $uname];
$this->mdSyliveUser->update($upDate, ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:修改状态
* Created on: 2022/9/21 16:10
* Created by: dengbw
*/
public function status_put()
{
$userId = $this->input_param('userId');
$status = $this->input_param('status');
if (!$userId) {
$this->return_json('参数错误');
}
$this->mdSyliveUser->update(['status' => $status], ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:删除用户
* Created on: 2022/9/21 16:10
* Created by: dengbw
* @param null $userId
*/
public function index_delete($userId = null)
{
if (!$userId) {
$this->return_json('参数错误');
}
$this->mdSyliveUser->update(['status' => -1], ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:批量删除用户
* Created on: 2022/9/8 17:11
* Created by: dengbw
*/
public function batch_delete()
{
$ids = $this->input_param('ids');
if (!$ids) {
$this->return_json('参数错误');
}
$str_ids = implode(',', $ids);
if ($str_ids) {
$this->mdSyliveUser->update(['status' => -1], ["userId in($str_ids)" => null]);
}
$this->return_response();
}
/**
* Notes:栓验字段
* Created on: 2022/9/21 15:52
* Created by: dengbw
*/
public function existence_get()
{
$field = $this->input_param('field');
$value = $this->input_param('value');
$organizationId = intval($this->input_param('organizationId'));
if ($organizationId) {
$topOrgId = $this->getTopOrgId($organizationId);
$where = [$field => $value, 'topOrgId' => $topOrgId, 'status>=' => 0];
$re = $this->mdSyliveUser->get($where);
if ($re) {
if ($field == 'mobile') {
if ($re['teamId'] || $re['organizationId']) {
$this->return_json('已存在', 0);
}
} else {
$this->return_json('已存在', 0);
}
}
}
$this->return_json('不存在', 1);
}
/**
* Notes:获取顶级机构id
* Created on: 2022/12/8 14:39
* Created by: dengbw
* @param $organizationId
* @param $topOrgId
* @return mixed
*/
private function getTopOrgId($organizationId, $topOrgId = 0)
{
$re = $this->mdSyliveOrganization->get(['organizationId' => $organizationId], 'organizationId,parentId');
if (!$re) {
return $topOrgId;
} else {
$topOrgId = $re['organizationId'];
if ($re['parentId']) {
return $this->getTopOrgId($re['parentId'], $topOrgId);
} else {
return $topOrgId;
}
}
}
}
@@ -0,0 +1,164 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:私域直播_团队管理
* Created on: 2022/9/16 17:15
* Created by: dengbw
*/
class Team extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sylive_team_model', 'mdSyliveTeam');
}
/**
* Notes:获取团队
* Created on: 2022/9/16 11:11
* Created by: dengbw
*/
public function index_get()
{
$unTeamType = $this->input_param('unTeamType');
$where['status>='] = 0;
$unTeamType && $where['teamType<>'] = $unTeamType;
$sort_order = 'sortNumber asc,teamId desc';
if ($_SESSION['brandName']) {//只找该品牌机构
$this->load->model('agent/admin/Market_sylive_organization_model', 'mdSyliveOrganization');
$re_org = $this->mdSyliveOrganization->get(['organizationName' => $_SESSION['brandName'], 'parentId' => 0, 'status' => 0]);
if ($re_org['organizationId']) {
$res_team = $this->mdSyliveTeam->select(['status>=' => 0, 'organizationId' => $re_org['organizationId']], 'parentId asc,sortNumber asc', 0, 0, 'teamId');
if ($res_team) {
$teamIds = [];
foreach ($res_team as $k => $v) {
$teamIds[] = $v['teamId'];
}
$res_all = $this->mdSyliveTeam->select($where, 'parentId asc,sortNumber asc', 0, 0, 'teamId,parentId');
foreach ($res_all as $k => $v) {
if (in_array($v['parentId'], $teamIds)) {
$teamIds[] = $v['teamId'];
}
}
$str_teamIds = implode(',', array_unique($teamIds));
$where["teamId in({$str_teamIds})"] = null;
} else {
$where['teamId'] = -1;
}
} else {
$where['teamId'] = -1;
}
}
$res = $this->mdSyliveTeam->select($where, $sort_order);
foreach ($res as $k => $v) {
$res[$k]['teamId'] = intval($v['teamId']);
$res[$k]['parentId'] = $v['parentId'] ? intval($v['parentId']) : '';
$res[$k]['sortNumber'] = intval($v['sortNumber']);
$res[$k]['organizationId'] = $v['organizationId'] ? intval($v['organizationId']) : '';
$city = $logo = [];
if ($v['cityId']) {
$city[] = $v['provinceId'];
$city[] = $v['cityId'];
}
$res[$k]['city'] = $city;
if ($v['logo']) {
$logo[] = ['uid' => 1, 'fileUrl' => $v['logo'], 'url' => build_qiniu_image_url($v['logo']), 'status' => 'done'];
}
$res[$k]['logo'] = $logo;
}
$this->return_response_list($res);
}
/**
* Notes:添加团队
* Created on: 2022/9/19 16:43
* Created by: dengbw
*/
public function index_post()
{
$parentId = intval($this->input_param('parentId'));
$teamName = $this->input_param('teamName');
$sortNumber = intval($this->input_param('sortNumber'));
$comments = $this->input_param('comments');
$city = $this->input_param('city');
$teamType = $this->input_param('teamType');
$organizationId = intval($this->input_param('organizationId'));
$logo = $this->input_param('logo');
if (!$teamName) {
$this->return_json('请输入团队名称');
}
if (!$parentId && !$organizationId) {
$this->return_json('请选择所属团队');
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$addDate = ['parentId' => $parentId, 'teamName' => $teamName, 'sortNumber' => $sortNumber, 'comments' => $comments
, 'teamType' => $teamType, 'organizationId' => $organizationId, 'logo' => $logo, 'createTime' => date('Y-m-d H:i:s')];
if ($city) {
$addDate['provinceId'] = intval($city[0]);
$addDate['cityId'] = intval($city[1]);
}
$id = $this->mdSyliveTeam->add($addDate);
if (!$id) {
$this->return_json('添加团队失败');
}
$this->return_response();
}
/**
* Notes:修改团队
* Created on: 2022/9/19 17:29
* Created by: dengbw
*/
public function index_put()
{
$teamId = intval($this->input_param('teamId'));
$parentId = intval($this->input_param('parentId'));
$teamName = $this->input_param('teamName');
$sortNumber = intval($this->input_param('sortNumber'));
$comments = $this->input_param('comments');
$city = $this->input_param('city');
$teamType = $this->input_param('teamType');
$organizationId = intval($this->input_param('organizationId'));
$logo = $this->input_param('logo');
if (!$teamId) {
$this->return_json('参数错误');
}
if (!$teamName) {
$this->return_json('请输入团队名称');
}
if (!$parentId && !$organizationId) {
$this->return_json('请选择所属团队');
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$upDate = ['parentId' => $parentId, 'teamName' => $teamName, 'sortNumber' => $sortNumber, 'comments' => $comments
, 'teamType' => $teamType, 'organizationId' => $organizationId, 'logo' => $logo];
if ($city) {
$upDate['provinceId'] = intval($city[0]);
$upDate['cityId'] = intval($city[1]);
}
$this->mdSyliveTeam->update($upDate, ['teamId' => $teamId]);
$this->return_response();
}
/**
* Notes:删除团队
* Created on: 2022/9/19 11:08
* Created by: dengbw
* @param null $teamId
*/
public function index_delete($teamId = null)
{
$teamId = intval($teamId);
if (!$teamId) {
$this->return_json('参数错误');
}
$this->mdSyliveTeam->update(['status' => -1], ['teamId' => $teamId]);
$this->return_response();
}
}
@@ -0,0 +1,244 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
/**
* Notes:私域直播_团队用户管理
* Created on: 2022/10/24 17:15
* Created by: dengbw
*/
class TeamUser extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/admin/Market_sylive_user_model', 'mdSyliveUser');
$this->load->model('agent/admin/Market_sylive_team_model', 'mdSyliveTeam');
}
/**
* Notes:用户管理列表
* Created on: 2022/9/20 14:48
* Created by: dengbw
*/
public function page_get()
{
$page = $this->input_param('page');
$limit = $this->input_param('limit');
$uname = $this->input_param('uname');
$nickname = $this->input_param('nickname');
$sort = $this->input_param('sort');
$order = $this->input_param('order');
$teamId = intval($this->input_param('teamId'));
!$page && $page = 1;
!$limit && $limit = 10;
$sort_order = 'userId desc';
if ($sort && $order) {
$sort_order = $sort . ' ' . $order;
}
$list = [];
$where['status>='] = 0;
$teamId && $where['teamId'] = $teamId;
$uname && $where['uname'] = $uname;
$nickname && $where['nickname'] = $nickname;
$count = $this->mdSyliveUser->count($where);
if ($count) {
$res = $this->mdSyliveUser->select($where, $sort_order, $page, $limit);
foreach ($res as $v) {
$status = intval($v['status']);
$createTime = $v['createTime'] != '0000-00-00 00:00:00' ? $v['createTime'] : '';
$list[] = [
'userId' => $v['userId'], 'uname' => $v['uname'], 'nickname' => $v['nickname'], 'mobile' => $v['mobile']
, 'teamId' => $teamId, 'status' => $status, 'createTime' => $createTime];
}
}
$date = ['list' => $list, 'count' => $count];
$this->return_response_list($date);
}
/**
* Notes:获取团队用户
* Created on: 2022/11/30 15:37
* Created by: dengbw
*/
public function list_post()
{
$this->load->model('agent/admin/Market_sylive_groups_user_model', 'mdSyliveGroupsUser');
$this->load->model('agent/admin/Market_sylive_groups_model', 'mdSyliveGroups');
$activityId = intval($this->input_param('activityId'));
$teamIds = $this->input_param('teamIds');
$keyword = trim($this->input_param('keyword'));
$where = ['status>=' => 0, 'teamId>' => 0];
if ($keyword) {
$where["(uname LIKE '%{$keyword}%' OR mobile LIKE '%{$keyword}%')"] = null;
} else if ($teamIds) {
$teamIds_str = implode(',', $teamIds);
$res_tea = $this->mdSyliveTeam->select(["parentId in({$teamIds_str})" => null], 'teamId desc', 0, 0, 'teamId');
foreach ($res_tea as $v) {
$teamIds[] = $v['teamId'];
}
$teamIds = implode(',', $teamIds);
$where["teamId in({$teamIds})"] = null;
}
$res = $this->mdSyliveUser->select($where, 'userId desc', 0, 0, 'userId,uname,mobile,teamId');
if ($keyword && $res) {
$teamIds = [];
foreach ($res as $v) {
$v['teamId'] && $teamIds[] = $v['teamId'];
}
$teamIds && $teamIds = implode(',', $teamIds);
}
$map_team = $map_team2 = [];
if ($teamIds) {
$map_team = $this->mdSyliveTeam->map('teamId', 'teamName,teamType', ["teamId in({$teamIds})" => null]);
}
$list = [];
foreach ($res as $v) {
$uname = $v['uname'] ? $v['uname'] : '-';
$team = $map_team[$v['teamId']];
$teamName = $team['teamName'] ? $team['teamName'] : '-';
$type = 2;
if ($team['teamType'] == 2) {
$type = 1;
} else if ($team['teamType'] == 3) {
$type = 0;
}
$groups = 0;
$re_gro_use = $this->mdSyliveGroupsUser->get(['activityId' => $activityId, 'userId' => $v['userId']
, 'status>=' => 0], 'groupsId,bizId');
if ($re_gro_use) {
$groups = 1;
$groupsId = $re_gro_use['bizId'] ? $re_gro_use['bizId'] : $re_gro_use['groupsId'];
$re_gro = $this->mdSyliveGroups->get(['activityId' => $activityId, 'groupsId' => $groupsId
, 'status>=' => 0], 'groupsName');
$re_gro['groupsName'] && $teamName .= "(分组-{$re_gro['groupsName']})";
}
$list[] = ['userId' => $v['userId'], 'uname' => $uname, 'mobile' => $v['mobile'], 'type' => $type
, 'groups' => $groups, 'teamName' => $teamName];
}
$this->return_response_list($list);
}
/**
* Notes:添加用户
* Created on: 2022/9/21 16:46
* Created by: dengbw
*/
public function index_post()
{
$mobile = $this->input_param('mobile');
$teamId = intval($this->input_param('teamId'));
$uname = $this->input_param('uname');
if (!$mobile) {
$this->return_json('请输入手机号');
}
if (!$teamId) {
$this->return_json('请选择所属团队');
}
if (!$uname) {
$this->return_json('请输入姓名');
}
$re = $this->mdSyliveUser->get(['mobile' => $mobile]);
if ($re && $re['status'] != -1) {
if ($re['teamId'] || $re['organizationId']) {
$this->return_json('手机号已存在');
}
}
$addDate = ['teamId' => $teamId, 'uname' => $uname, 'status' => 0, 'organizationId' => 0];
if ($re['userId']) {
$this->mdSyliveUser->update($addDate, ['userId' => $re['userId']]);
$this->return_response([], '绑定用户成功');
} else {
$addDate['mobile'] = $mobile;
$addDate['createTime'] = date('Y-m-d H:i:s');
$id = $this->mdSyliveUser->add($addDate);
if (!$id) {
$this->return_json('添加用户失败');
}
$this->return_response();
}
}
/**
* Notes:修改用户
* Created on: 2022/9/21 14:48
* Created by: dengbw
*/
public function index_put()
{
$userId = intval($this->input_param('userId'));
$teamId = intval($this->input_param('teamId'));
$uname = $this->input_param('uname');
if (!$userId) {
$this->return_json('参数错误');
}
if (!$teamId) {
$this->return_json('请选择所属团队');
}
if (!$uname) {
$this->return_json('请输入姓名');
}
$upDate = ['teamId' => $teamId, 'uname' => $uname];
$this->mdSyliveUser->update($upDate, ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:修改状态
* Created on: 2022/9/21 16:10
* Created by: dengbw
*/
public function status_put()
{
$userId = $this->input_param('userId');
$status = $this->input_param('status');
if (!$userId) {
$this->return_json('参数错误');
}
$this->mdSyliveUser->update(['status' => $status], ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:删除用户
* Created on: 2022/9/21 16:10
* Created by: dengbw
* @param null $userId
*/
public function index_delete($userId = null)
{
if (!$userId) {
$this->return_json('参数错误');
}
$this->mdSyliveUser->update(['status' => -1], ['userId' => $userId]);
$this->return_response();
}
/**
* Notes:栓验字段
* Created on: 2022/9/21 15:52
* Created by: dengbw
*/
public function existence_get()
{
$field = $this->input_param('field');
$value = $this->input_param('value');
$id = $this->input_param('id');
if (!$id) {
$where = [$field => $value, 'status<>' => -1];
$re = $this->mdSyliveUser->get($where);
if ($re) {
if ($field == 'mobile') {
if ($re['teamId'] || $re['organizationId']) {
$this->return_json('已存在', 0);
}
} else {
$this->return_json('已存在', 0);
}
}
}
$this->return_json('不存在', 1);
}
}
@@ -0,0 +1,95 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
class Cmmssn extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/organization/Organization_model', 'mdOrganization');
$this->load->model('agent/organization/Organization_cmmssn_model', 'mdOrganizationCmmssn');
}
public function index_get()
{
$teamId = $this->input_param('teamId');
$where = [
'teamId' => $teamId
];
$res = $this->mdOrganizationCmmssn->get($where);
$teamLevel = $this->mdOrganization->getTeamLevel($teamId);
if (!$res) {
$res['teamId'] = $teamId;
}
$res['showLevel'] = $teamLevel;
$this->return_response($res);
}
public function index_put()
{
$params = $this->input_param();
$upData = [
'cluesLevel1' => $params['cluesLevel1'] ?: 0,
'cluesLevel2' => $params['cluesLevel2'] ?: 0,
'cluesLevel3' => $params['cluesLevel3'] ?: 0,
'cluesLevel4' => $params['cluesLevel4'] ?: 0,
'orderLevel1' => $params['orderLevel1'] ?: 0,
'orderLevel2' => $params['orderLevel2'] ?: 0,
'orderLevel3' => $params['orderLevel3'] ?: 0,
'orderLevel4' => $params['orderLevel4'] ?: 0,
];
if ($params['id']) {
$upData['createTime'] = date('Y-m-d H:i:s');
$this->mdOrganizationCmmssn->update($upData, ['id' => $params['id']]);
} else {
$upData['teamId'] = $params['teamId'];
$this->mdOrganizationCmmssn->add($upData);
}
$this->return_response();
}
public function index_post()
{
$parentId = intval($this->input_param('parentId'));
$title = $this->input_param('title');
if (!$title) {
$this->return_json('请输入名称');
}
$remark = $this->input_param('remark');
$imgs = getImageFromArray($this->input_param('logo'));
$level = 0;
if ($parentId) {
$level = $this->mdOrganization->getLevel($parentId);
$level += 1;
}
if ($level > 5) {
$this->return_json('最多只能添加4级');
}
if ($level > 1) {
if ($this->mdOrganization->get(['parentId' => $parentId, 'status' => 0])) {
$this->return_json('该节点下已有子节点');
}
}
$addData = ['parentId' => $parentId, 'title' => $title, 'level' => $level, 'createTime' => date('Y-m-d H:i:s')];
$remark && $addData['remark'] = $remark;
$imgs && $addData['logo'] = $imgs[0];
$id = $this->mdOrganization->add($addData);
if (!$id) {
$this->return_json('添加失败');
}
$this->return_response();
}
public function index_delete()
{
$id = intval($this->input_param('id'));
if (!$id) {
$this->return_json('参数错误');
}
$this->mdOrganization->update(['status' => -1], ['id' => $id]);
$this->return_response();
}
}
@@ -0,0 +1,124 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
require_once APPPATH . 'controllers/api/BaseController.php';
class Manage extends BaseController
{
public function __construct()
{
parent::__construct();
$this->load->model('agent/organization/Organization_model', 'mdOrganization');
$this->load->model('agent/organization/Organization_cmmssn_model', 'mdOrganizationCmmssn');
$this->load->helper('image');
}
public function index_get()
{
$title = $this->input_param('title');
$pid = $this->input_param('pid');
$where['status'] = 0;
$sort_order = 'id desc';
$title && $where['title'] = $title;
strlen($pid) && $where['parentId'] = $pid;
$res = $this->mdOrganization->select($where, $sort_order);
if ($res) {
foreach ($res as $k => $v) {
$res[$k]['id'] = intval($v['id']);
$res[$k]['parentId'] = intval($v['parentId']);
$res[$k]['cfId'] = intval($v['cfId']);
$res[$k]['logo'] = $v['logo'] ? changeImg(explode(',', $v['logo'])) : [];
$res[$k]['level'] = intval($v['level']);
$res[$k]['roleId'] = $v['roleId'] ? intval($v['roleId']) : '';
}
}
$this->return_response_list($res);
}
public function index_put()
{
$id = $this->input_param('id');
$parentId = intval($this->input_param('parentId'));
$cfId = intval($this->input_param('cfId'));
$roleId = intval($this->input_param('roleId'));
$row = $this->mdOrganization->get(['id' => $id]);
$title = $this->input_param('title');
if (!$row) {
$this->return_json('参数错误');
}
if (!$title) {
$this->return_json('请输入菜单名称');
}
$remark = $this->input_param('remark');
$imgs = getImageFromArray($this->input_param('logo'));
$upData = ['parentId' => $parentId, 'title' => $title];
$remark && $upData['remark'] = $remark;
if ($row['parentId'] != $parentId) {
$level = 0;
if ($parentId) {
$level = $this->mdOrganization->getLevel($parentId);
$level += 1;
}
$upData['level'] = $level;
if ($level > 5) {
$this->return_json('最多只能添加4级');
}
}
if ($level > 1) {
if ($this->mdOrganization->get(['parentId' => $parentId, 'status' => 0, "id != " => $id])) {
$this->return_json('该节点下已有子节点');
}
}
$imgs && $upData['logo'] = $imgs[0];
$cfId && $upData['cfId'] = $cfId;
$roleId && $upData['roleId'] = $roleId;
$this->mdOrganization->update($upData, ['id' => $id]);
$this->return_response();
}
public function index_post()
{
$parentId = intval($this->input_param('parentId'));
$cfId = intval($this->input_param('cfId'));
$roleId = intval($this->input_param('roleId'));
$title = $this->input_param('title');
if (!$title) {
$this->return_json('请输入名称');
}
$remark = $this->input_param('remark');
$imgs = getImageFromArray($this->input_param('logo'));
$level = 0;
if ($parentId) {
$level = $this->mdOrganization->getLevel($parentId);
$level += 1;
}
if ($level > 5) {
$this->return_json('最多只能添加4级');
}
if ($level > 1) {
if ($this->mdOrganization->get(['parentId' => $parentId, 'status' => 0])) {
$this->return_json('该节点下已有子节点');
}
}
$addData = ['parentId' => $parentId, 'title' => $title, 'level' => $level, 'createTime' => date('Y-m-d H:i:s')];
$remark && $addData['remark'] = $remark;
$imgs && $addData['logo'] = $imgs[0];
$cfId && $addData['cfId'] = $cfId;
$roleId && $addData['roleId'] = $roleId;
$id = $this->mdOrganization->add($addData);
if (!$id) {
$this->return_json('添加失败');
}
$this->return_response();
}
public function index_delete()
{
$id = intval($this->input_param('id'));
if (!$id) {
$this->return_json('参数错误');
}
$this->mdOrganization->update(['status' => -1], ['id' => $id]);
$this->return_response();
}
}

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