diff --git a/application/admin/command/FcInstall.php b/application/admin/command/FcInstall.php index 52f3612..654f1a6 100644 --- a/application/admin/command/FcInstall.php +++ b/application/admin/command/FcInstall.php @@ -51,9 +51,111 @@ class FcInstall extends Command $output->writeln('==> 已有数据,跳过种子(如需重置请加 --reset)'); } + $output->writeln('==> 初始化后台菜单'); + $this->menu($output); + $output->writeln('==> 完成'); } + /** + * 初始化 FastAdmin 后台菜单(幂等) + * + * 结构: + * 同城业务 (fc) + * ├─ 内容管理 分类管理 / 轮播管理 / 信息管理 / 评价管理 / 举报处理 + * ├─ 用户与商家 商家管理 / 会员管理 / 消息管理 + * ├─ 交易管理 订单管理 / 会员套餐 / 资金流水 / 佣金明细 / 付费查看记录 + * ├─ 分销管理 分销关系 / 提现审核 + * └─ 基础数据 服务区域 / 草稿箱 + */ + protected function menu(Output $output) + { + $now = time(); + $ruleTable = Db::name('auth_rule'); + + // 1) 顶级菜单 + $top = $ruleTable->where('name', 'fc')->find(); + $topData = [ + 'type' => 'file', 'title' => '同城业务', 'icon' => 'fa fa-map-marker', + 'ismenu' => 1, 'menutype' => 'addtabs', 'weigh' => 95, + 'status' => 'normal', 'updatetime' => $now, + ]; + if ($top) { + $ruleTable->where('id', $top['id'])->update($topData); + $topId = (int)$top['id']; + } else { + $topData['pid'] = 0; + $topData['name'] = 'fc'; + $topData['url'] = ''; + $topData['createtime'] = $now; + $topId = (int)$ruleTable->insertGetId($topData); + } + + // 2) 分组菜单 + $groups = [ + ['fc/content', '内容管理', 'fa fa-file-text-o', 90], + ['fc/user', '用户与商家', 'fa fa-users', 80], + ['fc/trade', '交易管理', 'fa fa-shopping-cart', 70], + ['fc/dist', '分销管理', 'fa fa-share-alt', 60], + ['fc/base', '基础数据', 'fa fa-database', 50], + ]; + $groupId = []; + foreach ($groups as $g) { + $row = $ruleTable->where('name', $g[0])->find(); + $data = [ + 'type' => 'menu', 'pid' => $topId, 'title' => $g[1], 'icon' => $g[2], + 'url' => '', 'ismenu' => 1, 'menutype' => 'addtabs', + 'weigh' => $g[3], 'status' => 'normal', 'updatetime' => $now, + ]; + if ($row) { + $ruleTable->where('id', $row['id'])->update($data); + $groupId[$g[0]] = (int)$row['id']; + } else { + $data['name'] = $g[0]; + $data['createtime'] = $now; + $groupId[$g[0]] = (int)$ruleTable->insertGetId($data); + } + } + + // 3) 各业务控制器归组 + 中文标题 + 图标 + 排序 + $items = [ + 'fc/category' => ['fc/content', '分类管理', 'fa fa-list', 95], + 'fc/banner' => ['fc/content', '轮播管理', 'fa fa-image', 90], + 'fc/post' => ['fc/content', '信息管理', 'fa fa-file-text', 85], + 'fc/comment' => ['fc/content', '评价管理', 'fa fa-star', 80], + 'fc/report' => ['fc/content', '举报处理', 'fa fa-flag', 75], + 'fc/merchant' => ['fc/user', '商家管理', 'fa fa-building', 95], + 'fc/userext' => ['fc/user', '会员管理', 'fa fa-user-circle', 90], + 'fc/message' => ['fc/user', '消息管理', 'fa fa-bell', 85], + 'fc/order' => ['fc/trade', '订单管理', 'fa fa-file-text-o', 95], + 'fc/plan' => ['fc/trade', '会员套餐', 'fa fa-diamond', 90], + 'fc/financeflow' => ['fc/trade', '资金流水', 'fa fa-money', 85], + 'fc/commission' => ['fc/trade', '佣金明细', 'fa fa-cny', 80], + 'fc/payview' => ['fc/trade', '付费查看记录', 'fa fa-eye', 75], + 'fc/distrelation' => ['fc/dist', '分销关系', 'fa fa-sitemap', 95], + 'fc/withdraw' => ['fc/dist', '提现审核', 'fa fa-credit-card', 90], + 'fc/area' => ['fc/base', '服务区域', 'fa fa-map-o', 95], + 'fc/draft' => ['fc/base', '草稿箱', 'fa fa-folder-o', 90], + ]; + $done = 0; + foreach ($items as $name => $m) { + if (!isset($groupId[$m[0]])) { + continue; + } + $aff = $ruleTable->where('name', $name)->update([ + 'pid' => $groupId[$m[0]], + 'title' => $m[1], + 'icon' => $m[2], + 'weigh' => $m[3], + 'ismenu' => 1, + 'status' => 'normal', + 'updatetime' => $now, + ]); + $done += $aff > 0 ? 1 : 1; + } + $output->writeln(' - 顶级 1 / 分组 ' . count($groups) . ' / 功能项 ' . $done); + } + /** 清空业务表(保留表结构) */ protected function truncateAll() { diff --git a/application/admin/controller/fc/Area.php b/application/admin/controller/fc/Area.php new file mode 100644 index 0000000..f54c289 --- /dev/null +++ b/application/admin/controller/fc/Area.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcArea; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Banner.php b/application/admin/controller/fc/Banner.php new file mode 100644 index 0000000..4bae53f --- /dev/null +++ b/application/admin/controller/fc/Banner.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcBanner; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Category.php b/application/admin/controller/fc/Category.php new file mode 100644 index 0000000..4a559bd --- /dev/null +++ b/application/admin/controller/fc/Category.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcCategory; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Comment.php b/application/admin/controller/fc/Comment.php new file mode 100644 index 0000000..63499a0 --- /dev/null +++ b/application/admin/controller/fc/Comment.php @@ -0,0 +1,98 @@ +model = new \app\admin\model\FcComment; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + /** + * 回复评价 + */ + public function reply() + { + $ids = $this->request->post('ids'); + $reply = $this->request->post('reply'); + if (trim((string)$reply) === '') { + $this->error('回复内容不能为空'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要回复的评价'); + } + $comments = Db::name('fc_comment')->where('id', 'in', $ids)->select(); + if (!$comments) { + $this->error('评价不存在'); + } + foreach ($comments as $comment) { + Db::name('fc_comment')->where('id', $comment['id'])->update([ + 'reply' => $reply, + 'replytime' => time(), + 'updatetime' => time(), + ]); + Db::name('fc_message')->insert([ + 'user_id' => $comment['user_id'], + 'type' => 'interact', + 'title' => '评价回复', + 'content' => '您的评价已收到回复:' . $reply, + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success('回复成功'); + } + + /** + * 评价置顶/取消置顶 + */ + public function top() + { + $ids = $this->request->post('ids'); + $top = (int)$this->request->post('top'); + if (!in_array($top, [0, 1])) { + $this->error('置顶状态错误'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要操作的评价'); + } + Db::name('fc_comment')->where('id', 'in', $ids)->update([ + 'top' => $top, + 'updatetime' => time(), + ]); + $this->success($top === 1 ? '置顶成功' : '取消置顶成功'); + } + + + +} diff --git a/application/admin/controller/fc/Commission.php b/application/admin/controller/fc/Commission.php new file mode 100644 index 0000000..acf83cc --- /dev/null +++ b/application/admin/controller/fc/Commission.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcCommission; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Distrelation.php b/application/admin/controller/fc/Distrelation.php new file mode 100644 index 0000000..aa02a82 --- /dev/null +++ b/application/admin/controller/fc/Distrelation.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcDistRelation; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Draft.php b/application/admin/controller/fc/Draft.php new file mode 100644 index 0000000..d8168c0 --- /dev/null +++ b/application/admin/controller/fc/Draft.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcDraft; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Financeflow.php b/application/admin/controller/fc/Financeflow.php new file mode 100644 index 0000000..e49cc3e --- /dev/null +++ b/application/admin/controller/fc/Financeflow.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcFinanceFlow; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Merchant.php b/application/admin/controller/fc/Merchant.php new file mode 100644 index 0000000..3e3b777 --- /dev/null +++ b/application/admin/controller/fc/Merchant.php @@ -0,0 +1,83 @@ +model = new \app\admin\model\FcMerchant; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + /** + * 审核商家资质 + */ + public function audit() + { + $ids = $this->request->post('ids'); + $auditStatus = (int)$this->request->post('auditStatus'); + $reason = $this->request->post('reason', ''); + if (!in_array($auditStatus, [1, 2])) { + $this->error('审核状态仅支持通过(1)/驳回(2)'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要审核的商家'); + } + $merchants = Db::name('fc_merchant')->where('id', 'in', $ids)->select(); + if (!$merchants) { + $this->error('商家不存在'); + } + foreach ($merchants as $merchant) { + Db::name('fc_merchant')->where('id', $merchant['id'])->update([ + 'audit_status' => $auditStatus, + 'audit_reason' => $reason, + 'shop_status' => $auditStatus === 1 ? 'normal' : 'banned', + 'updatetime' => time(), + ]); + if ($auditStatus === 1) { + Db::name('fc_user_ext')->where('user_id', $merchant['user_id'])->update(['user_type' => 2]); + } + Db::name('fc_message')->insert([ + 'user_id' => $merchant['user_id'], + 'type' => 'system', + 'title' => $auditStatus === 1 ? '审核通过' : '审核驳回', + 'content' => $auditStatus === 1 + ? '您的商家「' . $merchant['name'] . '」资质已审核通过' + : '您的商家「' . $merchant['name'] . '」资质审核未通过' . ($reason ? ',原因:' . $reason : ''), + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success('审核成功'); + } + + + +} diff --git a/application/admin/controller/fc/Message.php b/application/admin/controller/fc/Message.php new file mode 100644 index 0000000..fc4821d --- /dev/null +++ b/application/admin/controller/fc/Message.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcMessage; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Order.php b/application/admin/controller/fc/Order.php new file mode 100644 index 0000000..3086b35 --- /dev/null +++ b/application/admin/controller/fc/Order.php @@ -0,0 +1,112 @@ +model = new \app\admin\model\FcOrder; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + /** + * 订单退款 + */ + public function refund() + { + $ids = $this->request->post('ids'); + $amount = (float)$this->request->post('amount'); + $reason = $this->request->post('reason', ''); + if ($amount <= 0) { + $this->error('退款金额需大于 0'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要退款的订单'); + } + $orders = Db::name('fc_order')->where('id', 'in', $ids)->select(); + if (!$orders) { + $this->error('订单不存在'); + } + foreach ($orders as $order) { + Db::name('fc_order')->where('id', $order['id'])->update([ + 'status' => 'refunded', + 'refund_amount' => $amount, + 'refund_reason' => $reason, + 'updatetime' => time(), + ]); + Db::name('fc_message')->insert([ + 'user_id' => $order['user_id'], + 'type' => 'system', + 'title' => '订单退款', + 'content' => '您的订单「' . $order['order_no'] . '」已退款' . $amount . '元' . ($reason ? ',原因:' . $reason : ''), + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success('退款成功'); + } + + /** + * 订单补单 + */ + public function supplement() + { + $orderNo = $this->request->post('orderNo'); + if (trim((string)$orderNo) === '') { + $this->error('订单号不能为空'); + } + $order = Db::name('fc_order')->where('order_no', $orderNo)->find(); + if (!$order) { + $this->error('订单不存在'); + } + if ($order['status'] === 'paid') { + $this->success('订单已支付'); + } + Db::name('fc_order')->where('id', $order['id'])->update([ + 'status' => 'paid', + 'paytime' => time(), + 'updatetime' => time(), + ]); + Db::name('fc_finance_flow')->insert([ + 'flow_no' => 'SK' . date('YmdHis') . $order['id'], + 'type' => 'income', + 'scene' => '订单补单', + 'amount' => $order['amount'], + 'balance' => 0, + 'related_id' => $order['id'], + 'remark' => '订单补单', + 'createtime' => time(), + ]); + $this->success('补单成功'); + } + + + +} diff --git a/application/admin/controller/fc/Payview.php b/application/admin/controller/fc/Payview.php new file mode 100644 index 0000000..6b70070 --- /dev/null +++ b/application/admin/controller/fc/Payview.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcPayView; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Plan.php b/application/admin/controller/fc/Plan.php new file mode 100644 index 0000000..d2dbaaf --- /dev/null +++ b/application/admin/controller/fc/Plan.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcPlan; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Post.php b/application/admin/controller/fc/Post.php new file mode 100644 index 0000000..1dc86c1 --- /dev/null +++ b/application/admin/controller/fc/Post.php @@ -0,0 +1,114 @@ +model = new \app\admin\model\FcPost; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 审核信息 + */ + public function audit() + { + $ids = $this->request->post('ids'); + $auditStatus = (int)$this->request->post('auditStatus'); + $reason = $this->request->post('reason', ''); + if (!in_array($auditStatus, [1, 2])) { + $this->error('审核状态仅支持通过(1)/驳回(2)'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要审核的信息'); + } + $posts = Db::name('fc_post')->where('id', 'in', $ids)->select(); + if (!$posts) { + $this->error('信息不存在'); + } + foreach ($posts as $post) { + Db::name('fc_post')->where('id', $post['id'])->update([ + 'audit_status' => $auditStatus, + 'audit_reason' => $reason, + 'updatetime' => time(), + ]); + if ($auditStatus === 1 && !empty($post['category_id'])) { + Db::name('fc_category')->where('id', $post['category_id'])->setInc('post_count'); + } + Db::name('fc_message')->insert([ + 'user_id' => $post['user_id'], + 'type' => 'system', + 'title' => $auditStatus === 1 ? '审核通过' : '审核驳回', + 'content' => $auditStatus === 1 + ? '您发布的信息「' . $post['title'] . '」已审核通过' + : '您发布的信息「' . $post['title'] . '」审核未通过' . ($reason ? ',原因:' . $reason : ''), + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success('审核成功'); + } + + /** + * 下架信息 + */ + public function offline() + { + $ids = $this->request->post('ids'); + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要下架的信息'); + } + $posts = Db::name('fc_post')->where('id', 'in', $ids)->select(); + if (!$posts) { + $this->error('信息不存在'); + } + foreach ($posts as $post) { + Db::name('fc_post')->where('id', $post['id'])->update([ + 'status' => 0, + 'updatetime' => time(), + ]); + Db::name('fc_message')->insert([ + 'user_id' => $post['user_id'], + 'type' => 'system', + 'title' => '信息已下架', + 'content' => '您发布的信息「' . $post['title'] . '」已被下架', + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success('下架成功'); + } + + +} diff --git a/application/admin/controller/fc/Report.php b/application/admin/controller/fc/Report.php new file mode 100644 index 0000000..5b88a2e --- /dev/null +++ b/application/admin/controller/fc/Report.php @@ -0,0 +1,59 @@ +model = new \app\admin\model\FcReport; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + /** + * 处理举报 + */ + public function handle() + { + $ids = $this->request->post('ids'); + $remark = $this->request->post('remark', ''); + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要处理的举报'); + } + Db::name('fc_report')->where('id', 'in', $ids)->update([ + 'status' => 'handled', + 'remark' => $remark, + 'updatetime' => time(), + ]); + $this->success('处理成功'); + } + + + +} diff --git a/application/admin/controller/fc/Userext.php b/application/admin/controller/fc/Userext.php new file mode 100644 index 0000000..46cbed0 --- /dev/null +++ b/application/admin/controller/fc/Userext.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\FcUserExt; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/fc/Withdraw.php b/application/admin/controller/fc/Withdraw.php new file mode 100644 index 0000000..048752f --- /dev/null +++ b/application/admin/controller/fc/Withdraw.php @@ -0,0 +1,100 @@ +model = new \app\admin\model\FcWithdraw; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + /** + * 提现打款/驳回 + */ + public function pay() + { + $ids = $this->request->post('ids'); + $op = $this->request->post('op'); + $reason = $this->request->post('reason', ''); + if (!in_array($op, ['pay', 'reject'])) { + $this->error('操作类型错误'); + } + if ($op === 'reject' && trim((string)$reason) === '') { + $this->error('驳回需填写原因'); + } + $ids = is_array($ids) ? $ids : explode(',', (string)$ids); + $ids = array_filter($ids); + if (!$ids) { + $this->error('请选择要操作的提现记录'); + } + $withdraws = Db::name('fc_withdraw')->where('id', 'in', $ids)->select(); + if (!$withdraws) { + $this->error('提现记录不存在'); + } + foreach ($withdraws as $withdraw) { + if ($op === 'pay') { + Db::name('fc_withdraw')->where('id', $withdraw['id'])->update([ + 'status' => 'paid', + 'paytime' => time(), + 'updatetime' => time(), + ]); + Db::name('fc_finance_flow')->insert([ + 'flow_no' => 'WD' . date('YmdHis') . $withdraw['id'], + 'type' => 'expense', + 'scene' => '佣金提现', + 'amount' => $withdraw['amount'], + 'balance' => 0, + 'related_id' => $withdraw['id'], + 'remark' => '提现打款', + 'createtime' => time(), + ]); + } else { + Db::name('fc_withdraw')->where('id', $withdraw['id'])->update([ + 'status' => 'rejected', + 'reason' => $reason, + 'updatetime' => time(), + ]); + } + Db::name('fc_message')->insert([ + 'user_id' => $withdraw['user_id'], + 'type' => 'system', + 'title' => $op === 'pay' ? '提现成功' : '提现驳回', + 'content' => $op === 'pay' + ? '您的提现申请「' . $withdraw['withdraw_no'] . '」已打款,金额:' . $withdraw['amount'] . '元' + : '您的提现申请「' . $withdraw['withdraw_no'] . '」被驳回' . ($reason ? ',原因:' . $reason : ''), + 'isread' => 0, + 'createtime' => time(), + ]); + } + $this->success($op === 'pay' ? '打款成功' : '驳回成功'); + } + + + +} diff --git a/application/admin/lang/zh-cn/fc/area.php b/application/admin/lang/zh-cn/fc/area.php new file mode 100644 index 0000000..ca5d8ed --- /dev/null +++ b/application/admin/lang/zh-cn/fc/area.php @@ -0,0 +1,5 @@ + '图片,空则用渐变占位', + 'Link' => '跳转路径' +]; diff --git a/application/admin/lang/zh-cn/fc/category.php b/application/admin/lang/zh-cn/fc/category.php new file mode 100644 index 0000000..fd41fe2 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/category.php @@ -0,0 +1,10 @@ + '分类名', + 'Icon_key' => '图标key', + 'Color' => '主题色', + 'Sort' => '排序', + 'Enabled' => '是否启用', + 'Post_count' => '信息量' +]; diff --git a/application/admin/lang/zh-cn/fc/comment.php b/application/admin/lang/zh-cn/fc/comment.php new file mode 100644 index 0000000..b07da42 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/comment.php @@ -0,0 +1,7 @@ + '回复', + 'TopComment' => '置顶', + 'UnTopComment' => '取消置顶' +]; diff --git a/application/admin/lang/zh-cn/fc/commission.php b/application/admin/lang/zh-cn/fc/commission.php new file mode 100644 index 0000000..33aa030 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/commission.php @@ -0,0 +1,9 @@ + '获得佣金的人', + 'From_user_id' => '产生佣金的下线', + 'Amount' => '佣金金额', + 'Rate' => '分佣比例%', + 'Status' => '0未结算1已结算' +]; diff --git a/application/admin/lang/zh-cn/fc/distrelation.php b/application/admin/lang/zh-cn/fc/distrelation.php new file mode 100644 index 0000000..4a092b5 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/distrelation.php @@ -0,0 +1,7 @@ + '下线用户', + 'Parent_id' => '上级用户', + 'Level' => '1一级2二级' +]; diff --git a/application/admin/lang/zh-cn/fc/draft.php b/application/admin/lang/zh-cn/fc/draft.php new file mode 100644 index 0000000..ca5d8ed --- /dev/null +++ b/application/admin/lang/zh-cn/fc/draft.php @@ -0,0 +1,5 @@ + 'income/expense', + 'Scene' => '业务场景', + 'Balance' => '账后余额' +]; diff --git a/application/admin/lang/zh-cn/fc/merchant.php b/application/admin/lang/zh-cn/fc/merchant.php new file mode 100644 index 0000000..a55484c --- /dev/null +++ b/application/admin/lang/zh-cn/fc/merchant.php @@ -0,0 +1,9 @@ + '经营类目', + 'License' => '营业执照', + 'Shop_status' => 'normal/pending/banned', + 'AuditPass' => '审核通过', + 'AuditReject' => '审核驳回' +]; diff --git a/application/admin/lang/zh-cn/fc/message.php b/application/admin/lang/zh-cn/fc/message.php new file mode 100644 index 0000000..a7ee25a --- /dev/null +++ b/application/admin/lang/zh-cn/fc/message.php @@ -0,0 +1,6 @@ + '0=全体', + 'Type' => 'system/interact' +]; diff --git a/application/admin/lang/zh-cn/fc/order.php b/application/admin/lang/zh-cn/fc/order.php new file mode 100644 index 0000000..1a9fc9c --- /dev/null +++ b/application/admin/lang/zh-cn/fc/order.php @@ -0,0 +1,9 @@ + 'post/member/recharge', + 'Status' => 'pending/paid/refunded/closed', + 'Related_id' => '关联业务ID', + 'RefundOrder' => '退款', + 'SupplementOrder' => '补单' +]; diff --git a/application/admin/lang/zh-cn/fc/payview.php b/application/admin/lang/zh-cn/fc/payview.php new file mode 100644 index 0000000..ca5d8ed --- /dev/null +++ b/application/admin/lang/zh-cn/fc/payview.php @@ -0,0 +1,5 @@ + 'M1/M3/M12' +]; diff --git a/application/admin/lang/zh-cn/fc/post.php b/application/admin/lang/zh-cn/fc/post.php new file mode 100644 index 0000000..a7e9b98 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/post.php @@ -0,0 +1,17 @@ + '发布者', + 'Media' => '媒体JSON数组', + 'Contact' => '联系人', + 'Phone' => '联系电话(完整)', + 'Tags' => '标签,逗号分隔', + 'Is_paid' => '是否付费发布', + 'Amount' => '支付金额', + 'Audit_status' => '0待审1通过2驳回', + 'Status' => '1正常0下架', + 'Distance' => '距离(米)', + 'AuditPass' => '审核通过', + 'AuditReject' => '审核驳回', + 'OfflinePost' => '下架' +]; diff --git a/application/admin/lang/zh-cn/fc/report.php b/application/admin/lang/zh-cn/fc/report.php new file mode 100644 index 0000000..fee14e4 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/report.php @@ -0,0 +1,7 @@ + 'post/comment', + 'Status' => 'pending/handled', + 'HandleReport' => '处理' +]; diff --git a/application/admin/lang/zh-cn/fc/userext.php b/application/admin/lang/zh-cn/fc/userext.php new file mode 100644 index 0000000..2c9d657 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/userext.php @@ -0,0 +1,7 @@ + '微信openid', + 'User_type' => '1个人2商家', + 'Free_view_date' => '免费查看额度基准日' +]; diff --git a/application/admin/lang/zh-cn/fc/withdraw.php b/application/admin/lang/zh-cn/fc/withdraw.php new file mode 100644 index 0000000..d4a5e39 --- /dev/null +++ b/application/admin/lang/zh-cn/fc/withdraw.php @@ -0,0 +1,8 @@ + 'auditing/paid/rejected', + 'Reason' => '驳回原因', + 'PayWithdraw' => '打款', + 'RejectWithdraw' => '驳回' +]; diff --git a/application/admin/model/FcArea.php b/application/admin/model/FcArea.php new file mode 100644 index 0000000..6be3c9e --- /dev/null +++ b/application/admin/model/FcArea.php @@ -0,0 +1,50 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['sort' => $row[$pk]]); + } + }); + } + + + + + + + + + +} diff --git a/application/admin/model/FcBanner.php b/application/admin/model/FcBanner.php new file mode 100644 index 0000000..208672e --- /dev/null +++ b/application/admin/model/FcBanner.php @@ -0,0 +1,50 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['sort' => $row[$pk]]); + } + }); + } + + + + + + + + + +} diff --git a/application/admin/model/FcCategory.php b/application/admin/model/FcCategory.php new file mode 100644 index 0000000..7172ab4 --- /dev/null +++ b/application/admin/model/FcCategory.php @@ -0,0 +1,50 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['sort' => $row[$pk]]); + } + }); + } + + + + + + + + + +} diff --git a/application/admin/model/FcComment.php b/application/admin/model/FcComment.php new file mode 100644 index 0000000..21c8ba3 --- /dev/null +++ b/application/admin/model/FcComment.php @@ -0,0 +1,40 @@ + __('Status 16')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ?: ($data['status'] ?? ''); + $list = $this->getStatusList(); + return $list[$value] ?? ''; + } + + + + +} diff --git a/application/admin/model/FcPayView.php b/application/admin/model/FcPayView.php new file mode 100644 index 0000000..233d55e --- /dev/null +++ b/application/admin/model/FcPayView.php @@ -0,0 +1,40 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['sort' => $row[$pk]]); + } + }); + } + + + + + + + + + +} diff --git a/application/admin/model/FcPost.php b/application/admin/model/FcPost.php new file mode 100644 index 0000000..ea1c5ff --- /dev/null +++ b/application/admin/model/FcPost.php @@ -0,0 +1,40 @@ + __('Status 16')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ?: ($data['status'] ?? ''); + $list = $this->getStatusList(); + return $list[$value] ?? ''; + } + + + + +} diff --git a/application/admin/model/FcUserExt.php b/application/admin/model/FcUserExt.php new file mode 100644 index 0000000..804add7 --- /dev/null +++ b/application/admin/model/FcUserExt.php @@ -0,0 +1,40 @@ + __('Status 16')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ?: ($data['status'] ?? ''); + $list = $this->getStatusList(); + return $list[$value] ?? ''; + } + + + + +} diff --git a/application/admin/view/fc/area/add.html b/application/admin/view/fc/area/add.html new file mode 100644 index 0000000..f0874a4 --- /dev/null +++ b/application/admin/view/fc/area/add.html @@ -0,0 +1,27 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/area/edit.html b/application/admin/view/fc/area/edit.html new file mode 100644 index 0000000..f1e4537 --- /dev/null +++ b/application/admin/view/fc/area/edit.html @@ -0,0 +1,27 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/area/index.html b/application/admin/view/fc/area/index.html new file mode 100644 index 0000000..13eddfb --- /dev/null +++ b/application/admin/view/fc/area/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/banner/add.html b/application/admin/view/fc/banner/add.html new file mode 100644 index 0000000..3c9196d --- /dev/null +++ b/application/admin/view/fc/banner/add.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/banner/edit.html b/application/admin/view/fc/banner/edit.html new file mode 100644 index 0000000..6bed72d --- /dev/null +++ b/application/admin/view/fc/banner/edit.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/banner/index.html b/application/admin/view/fc/banner/index.html new file mode 100644 index 0000000..8e01057 --- /dev/null +++ b/application/admin/view/fc/banner/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/category/add.html b/application/admin/view/fc/category/add.html new file mode 100644 index 0000000..4475f3e --- /dev/null +++ b/application/admin/view/fc/category/add.html @@ -0,0 +1,49 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + + + +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/category/edit.html b/application/admin/view/fc/category/edit.html new file mode 100644 index 0000000..75f2c2f --- /dev/null +++ b/application/admin/view/fc/category/edit.html @@ -0,0 +1,49 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + + + +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/category/index.html b/application/admin/view/fc/category/index.html new file mode 100644 index 0000000..0321aab --- /dev/null +++ b/application/admin/view/fc/category/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/comment/add.html b/application/admin/view/fc/comment/add.html new file mode 100644 index 0000000..9db6189 --- /dev/null +++ b/application/admin/view/fc/comment/add.html @@ -0,0 +1,63 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/comment/edit.html b/application/admin/view/fc/comment/edit.html new file mode 100644 index 0000000..5a6052f --- /dev/null +++ b/application/admin/view/fc/comment/edit.html @@ -0,0 +1,63 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/comment/index.html b/application/admin/view/fc/comment/index.html new file mode 100644 index 0000000..b6a0c03 --- /dev/null +++ b/application/admin/view/fc/comment/index.html @@ -0,0 +1,32 @@ +
+ {:build_heading()} + +
+ +
+
diff --git a/application/admin/view/fc/commission/add.html b/application/admin/view/fc/commission/add.html new file mode 100644 index 0000000..604a293 --- /dev/null +++ b/application/admin/view/fc/commission/add.html @@ -0,0 +1,69 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/commission/edit.html b/application/admin/view/fc/commission/edit.html new file mode 100644 index 0000000..b8d5800 --- /dev/null +++ b/application/admin/view/fc/commission/edit.html @@ -0,0 +1,69 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/commission/index.html b/application/admin/view/fc/commission/index.html new file mode 100644 index 0000000..1101b0b --- /dev/null +++ b/application/admin/view/fc/commission/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/distrelation/add.html b/application/admin/view/fc/distrelation/add.html new file mode 100644 index 0000000..b192080 --- /dev/null +++ b/application/admin/view/fc/distrelation/add.html @@ -0,0 +1,27 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/distrelation/edit.html b/application/admin/view/fc/distrelation/edit.html new file mode 100644 index 0000000..d24cb8e --- /dev/null +++ b/application/admin/view/fc/distrelation/edit.html @@ -0,0 +1,27 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/distrelation/index.html b/application/admin/view/fc/distrelation/index.html new file mode 100644 index 0000000..7df8e58 --- /dev/null +++ b/application/admin/view/fc/distrelation/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/draft/add.html b/application/admin/view/fc/draft/add.html new file mode 100644 index 0000000..fc1af12 --- /dev/null +++ b/application/admin/view/fc/draft/add.html @@ -0,0 +1,63 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/draft/edit.html b/application/admin/view/fc/draft/edit.html new file mode 100644 index 0000000..59eb90d --- /dev/null +++ b/application/admin/view/fc/draft/edit.html @@ -0,0 +1,63 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/draft/index.html b/application/admin/view/fc/draft/index.html new file mode 100644 index 0000000..25fbd60 --- /dev/null +++ b/application/admin/view/fc/draft/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/financeflow/add.html b/application/admin/view/fc/financeflow/add.html new file mode 100644 index 0000000..20150b8 --- /dev/null +++ b/application/admin/view/fc/financeflow/add.html @@ -0,0 +1,51 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/financeflow/edit.html b/application/admin/view/fc/financeflow/edit.html new file mode 100644 index 0000000..cb3956e --- /dev/null +++ b/application/admin/view/fc/financeflow/edit.html @@ -0,0 +1,51 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/financeflow/index.html b/application/admin/view/fc/financeflow/index.html new file mode 100644 index 0000000..c9e55c4 --- /dev/null +++ b/application/admin/view/fc/financeflow/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/merchant/add.html b/application/admin/view/fc/merchant/add.html new file mode 100644 index 0000000..c3e1f12 --- /dev/null +++ b/application/admin/view/fc/merchant/add.html @@ -0,0 +1,75 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/merchant/edit.html b/application/admin/view/fc/merchant/edit.html new file mode 100644 index 0000000..a291457 --- /dev/null +++ b/application/admin/view/fc/merchant/edit.html @@ -0,0 +1,75 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/merchant/index.html b/application/admin/view/fc/merchant/index.html new file mode 100644 index 0000000..526c999 --- /dev/null +++ b/application/admin/view/fc/merchant/index.html @@ -0,0 +1,31 @@ +
+ {:build_heading()} + +
+ +
+
diff --git a/application/admin/view/fc/message/add.html b/application/admin/view/fc/message/add.html new file mode 100644 index 0000000..44d35ee --- /dev/null +++ b/application/admin/view/fc/message/add.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/message/edit.html b/application/admin/view/fc/message/edit.html new file mode 100644 index 0000000..a4b60c5 --- /dev/null +++ b/application/admin/view/fc/message/edit.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/message/index.html b/application/admin/view/fc/message/index.html new file mode 100644 index 0000000..0fc9eb6 --- /dev/null +++ b/application/admin/view/fc/message/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/order/add.html b/application/admin/view/fc/order/add.html new file mode 100644 index 0000000..6fa96c6 --- /dev/null +++ b/application/admin/view/fc/order/add.html @@ -0,0 +1,81 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/order/edit.html b/application/admin/view/fc/order/edit.html new file mode 100644 index 0000000..c8a9ed2 --- /dev/null +++ b/application/admin/view/fc/order/edit.html @@ -0,0 +1,81 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/order/index.html b/application/admin/view/fc/order/index.html new file mode 100644 index 0000000..7bf3270 --- /dev/null +++ b/application/admin/view/fc/order/index.html @@ -0,0 +1,48 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+ + +
+
+
+ +
+
+
diff --git a/application/admin/view/fc/payview/add.html b/application/admin/view/fc/payview/add.html new file mode 100644 index 0000000..04cd425 --- /dev/null +++ b/application/admin/view/fc/payview/add.html @@ -0,0 +1,39 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/payview/edit.html b/application/admin/view/fc/payview/edit.html new file mode 100644 index 0000000..661d51a --- /dev/null +++ b/application/admin/view/fc/payview/edit.html @@ -0,0 +1,39 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/payview/index.html b/application/admin/view/fc/payview/index.html new file mode 100644 index 0000000..88b0dc8 --- /dev/null +++ b/application/admin/view/fc/payview/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/plan/add.html b/application/admin/view/fc/plan/add.html new file mode 100644 index 0000000..ea829f7 --- /dev/null +++ b/application/admin/view/fc/plan/add.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/plan/edit.html b/application/admin/view/fc/plan/edit.html new file mode 100644 index 0000000..7fb67b2 --- /dev/null +++ b/application/admin/view/fc/plan/edit.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/plan/index.html b/application/admin/view/fc/plan/index.html new file mode 100644 index 0000000..f1c84f0 --- /dev/null +++ b/application/admin/view/fc/plan/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/post/add.html b/application/admin/view/fc/post/add.html new file mode 100644 index 0000000..c4deae2 --- /dev/null +++ b/application/admin/view/fc/post/add.html @@ -0,0 +1,159 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/post/edit.html b/application/admin/view/fc/post/edit.html new file mode 100644 index 0000000..bbb499f --- /dev/null +++ b/application/admin/view/fc/post/edit.html @@ -0,0 +1,159 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/post/index.html b/application/admin/view/fc/post/index.html new file mode 100644 index 0000000..5506276 --- /dev/null +++ b/application/admin/view/fc/post/index.html @@ -0,0 +1,32 @@ +
+ {:build_heading()} + +
+ +
+
diff --git a/application/admin/view/fc/post/recyclebin.html b/application/admin/view/fc/post/recyclebin.html new file mode 100644 index 0000000..e6dc46e --- /dev/null +++ b/application/admin/view/fc/post/recyclebin.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/report/add.html b/application/admin/view/fc/report/add.html new file mode 100644 index 0000000..7976809 --- /dev/null +++ b/application/admin/view/fc/report/add.html @@ -0,0 +1,51 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/report/edit.html b/application/admin/view/fc/report/edit.html new file mode 100644 index 0000000..f101053 --- /dev/null +++ b/application/admin/view/fc/report/edit.html @@ -0,0 +1,51 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/report/index.html b/application/admin/view/fc/report/index.html new file mode 100644 index 0000000..791af59 --- /dev/null +++ b/application/admin/view/fc/report/index.html @@ -0,0 +1,47 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+
+ + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + {:__('HandleReport')} + + + + + +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/fc/userext/add.html b/application/admin/view/fc/userext/add.html new file mode 100644 index 0000000..6acfecb --- /dev/null +++ b/application/admin/view/fc/userext/add.html @@ -0,0 +1,75 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/userext/edit.html b/application/admin/view/fc/userext/edit.html new file mode 100644 index 0000000..35d978d --- /dev/null +++ b/application/admin/view/fc/userext/edit.html @@ -0,0 +1,75 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/userext/index.html b/application/admin/view/fc/userext/index.html new file mode 100644 index 0000000..5963d6e --- /dev/null +++ b/application/admin/view/fc/userext/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/fc/withdraw/add.html b/application/admin/view/fc/withdraw/add.html new file mode 100644 index 0000000..4be5613 --- /dev/null +++ b/application/admin/view/fc/withdraw/add.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/withdraw/edit.html b/application/admin/view/fc/withdraw/edit.html new file mode 100644 index 0000000..4075862 --- /dev/null +++ b/application/admin/view/fc/withdraw/edit.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/fc/withdraw/index.html b/application/admin/view/fc/withdraw/index.html new file mode 100644 index 0000000..26ce435 --- /dev/null +++ b/application/admin/view/fc/withdraw/index.html @@ -0,0 +1,48 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+ + +
+
+
+ +
+
+
diff --git a/public/assets/js/backend/fc/area.js b/public/assets/js/backend/fc/area.js new file mode 100644 index 0000000..b00200b --- /dev/null +++ b/public/assets/js/backend/fc/area.js @@ -0,0 +1,55 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/area/index' + location.search, + add_url: 'fc/area/add', + edit_url: 'fc/area/edit', + del_url: 'fc/area/del', + multi_url: 'fc/area/multi', + import_url: 'fc/area/import', + table: 'fc_area', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'sort', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'sort', title: __('Sort')}, + {field: 'enabled', title: __('Enabled')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/banner.js b/public/assets/js/backend/fc/banner.js new file mode 100644 index 0000000..9a3e0b0 --- /dev/null +++ b/public/assets/js/backend/fc/banner.js @@ -0,0 +1,58 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/banner/index' + location.search, + add_url: 'fc/banner/add', + edit_url: 'fc/banner/edit', + del_url: 'fc/banner/del', + multi_url: 'fc/banner/multi', + import_url: 'fc/banner/import', + table: 'fc_banner', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'sort', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'title', title: __('Title'), operate: 'LIKE'}, + {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'link', title: __('Link'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'color', title: __('Color'), operate: 'LIKE'}, + {field: 'sort', title: __('Sort')}, + {field: 'enabled', title: __('Enabled')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/category.js b/public/assets/js/backend/fc/category.js new file mode 100644 index 0000000..b5218aa --- /dev/null +++ b/public/assets/js/backend/fc/category.js @@ -0,0 +1,58 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/category/index' + location.search, + add_url: 'fc/category/add', + edit_url: 'fc/category/edit', + del_url: 'fc/category/del', + multi_url: 'fc/category/multi', + import_url: 'fc/category/import', + table: 'fc_category', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'sort', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'icon_key', title: __('Icon_key'), operate: 'LIKE'}, + {field: 'color', title: __('Color'), operate: 'LIKE'}, + {field: 'sort', title: __('Sort')}, + {field: 'enabled', title: __('Enabled'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.normal}, + {field: 'post_count', title: __('Post_count')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/comment.js b/public/assets/js/backend/fc/comment.js new file mode 100644 index 0000000..695142e --- /dev/null +++ b/public/assets/js/backend/fc/comment.js @@ -0,0 +1,108 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/comment/index' + location.search, + add_url: 'fc/comment/add', + edit_url: 'fc/comment/edit', + del_url: 'fc/comment/del', + multi_url: 'fc/comment/multi', + import_url: 'fc/comment/import', + table: 'fc_comment', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'post_id', title: __('Post_id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'score', title: __('Score')}, + {field: 'content', title: __('Content'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'reply', title: __('Reply'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'replytime', title: __('Replytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'top', title: __('Top')}, + {field: 'status', title: __('Status')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 回复 + $(document).on('click', '.btn-reply', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入回复内容'), formType: 2}, function (value, index) { + Fast.api.ajax({ + url: 'fc/comment/reply', + data: {ids: ids.join(','), reply: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 置顶 + $(document).on('click', '.btn-top', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认置顶选中的评价?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/comment/top', + data: {ids: ids.join(','), top: 1} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 取消置顶 + $(document).on('click', '.btn-untop', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认取消置顶选中的评价?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/comment/top', + data: {ids: ids.join(','), top: 0} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/commission.js b/public/assets/js/backend/fc/commission.js new file mode 100644 index 0000000..7fbe3cf --- /dev/null +++ b/public/assets/js/backend/fc/commission.js @@ -0,0 +1,63 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/commission/index' + location.search, + add_url: 'fc/commission/add', + edit_url: 'fc/commission/edit', + del_url: 'fc/commission/del', + multi_url: 'fc/commission/multi', + import_url: 'fc/commission/import', + table: 'fc_commission', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'from_user_id', title: __('From_user_id')}, + {field: 'order_id', title: __('Order_id')}, + {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, + {field: 'order_type', title: __('Order_type'), operate: 'LIKE'}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'rate', title: __('Rate'), operate:'BETWEEN'}, + {field: 'level', title: __('Level')}, + {field: 'status', title: __('Status')}, + {field: 'settletime', title: __('Settletime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/distrelation.js b/public/assets/js/backend/fc/distrelation.js new file mode 100644 index 0000000..09bb69f --- /dev/null +++ b/public/assets/js/backend/fc/distrelation.js @@ -0,0 +1,54 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/distrelation/index' + location.search, + add_url: 'fc/distrelation/add', + edit_url: 'fc/distrelation/edit', + del_url: 'fc/distrelation/del', + multi_url: 'fc/distrelation/multi', + import_url: 'fc/distrelation/import', + table: 'fc_dist_relation', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'parent_id', title: __('Parent_id')}, + {field: 'level', title: __('Level')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/draft.js b/public/assets/js/backend/fc/draft.js new file mode 100644 index 0000000..5197366 --- /dev/null +++ b/public/assets/js/backend/fc/draft.js @@ -0,0 +1,61 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/draft/index' + location.search, + add_url: 'fc/draft/add', + edit_url: 'fc/draft/edit', + del_url: 'fc/draft/del', + multi_url: 'fc/draft/multi', + import_url: 'fc/draft/import', + table: 'fc_draft', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'category_id', title: __('Category_id')}, + {field: 'title', title: __('Title'), operate: 'LIKE'}, + {field: 'contact', title: __('Contact'), operate: 'LIKE'}, + {field: 'phone', title: __('Phone'), operate: 'LIKE'}, + {field: 'address', title: __('Address'), operate: 'LIKE'}, + {field: 'savedat', title: __('Savedat')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/financeflow.js b/public/assets/js/backend/fc/financeflow.js new file mode 100644 index 0000000..a49545e --- /dev/null +++ b/public/assets/js/backend/fc/financeflow.js @@ -0,0 +1,58 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/financeflow/index' + location.search, + add_url: 'fc/financeflow/add', + edit_url: 'fc/financeflow/edit', + del_url: 'fc/financeflow/del', + multi_url: 'fc/financeflow/multi', + import_url: 'fc/financeflow/import', + table: 'fc_finance_flow', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'flow_no', title: __('Flow_no'), operate: 'LIKE'}, + {field: 'type', title: __('Type'), operate: 'LIKE'}, + {field: 'scene', title: __('Scene'), operate: 'LIKE'}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'balance', title: __('Balance'), operate:'BETWEEN'}, + {field: 'related_id', title: __('Related_id')}, + {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/merchant.js b/public/assets/js/backend/fc/merchant.js new file mode 100644 index 0000000..a7151a1 --- /dev/null +++ b/public/assets/js/backend/fc/merchant.js @@ -0,0 +1,96 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/merchant/index' + location.search, + add_url: 'fc/merchant/add', + edit_url: 'fc/merchant/edit', + del_url: 'fc/merchant/del', + multi_url: 'fc/merchant/multi', + import_url: 'fc/merchant/import', + table: 'fc_merchant', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'logo', title: __('Logo'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'contact', title: __('Contact'), operate: 'LIKE'}, + {field: 'category', title: __('Category'), operate: 'LIKE'}, + {field: 'license', title: __('License'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'audit_status', title: __('Audit_status')}, + {field: 'audit_reason', title: __('Audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'shop_status', title: __('Shop_status'), operate: 'LIKE', formatter: Table.api.formatter.status}, + {field: 'violations', title: __('Violations')}, + {field: 'post_count', title: __('Post_count')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 审核通过 + $(document).on('click', '.btn-audit-pass', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认审核通过选中的商家?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/merchant/audit', + data: {ids: ids.join(','), auditStatus: 1} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 审核驳回 + $(document).on('click', '.btn-audit-reject', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) { + Fast.api.ajax({ + url: 'fc/merchant/audit', + data: {ids: ids.join(','), auditStatus: 2, reason: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/message.js b/public/assets/js/backend/fc/message.js new file mode 100644 index 0000000..18bc6ea --- /dev/null +++ b/public/assets/js/backend/fc/message.js @@ -0,0 +1,57 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/message/index' + location.search, + add_url: 'fc/message/add', + edit_url: 'fc/message/edit', + del_url: 'fc/message/del', + multi_url: 'fc/message/multi', + import_url: 'fc/message/import', + table: 'fc_message', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'type', title: __('Type'), operate: 'LIKE'}, + {field: 'title', title: __('Title'), operate: 'LIKE'}, + {field: 'content', title: __('Content'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'isread', title: __('Isread')}, + {field: 'readtime', title: __('Readtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/order.js b/public/assets/js/backend/fc/order.js new file mode 100644 index 0000000..f9f286e --- /dev/null +++ b/public/assets/js/backend/fc/order.js @@ -0,0 +1,103 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/order/index' + location.search, + add_url: 'fc/order/add', + edit_url: 'fc/order/edit', + del_url: 'fc/order/del', + multi_url: 'fc/order/multi', + import_url: 'fc/order/import', + table: 'fc_order', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, + {field: 'user_id', title: __('User_id')}, + {field: 'type', title: __('Type'), operate: 'LIKE'}, + {field: 'title', title: __('Title'), operate: 'LIKE'}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'pay_type', title: __('Pay_type'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"16":__('Status 16')}, formatter: Table.api.formatter.status}, + {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'refund_amount', title: __('Refund_amount'), operate:'BETWEEN'}, + {field: 'refund_reason', title: __('Refund_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'related_id', title: __('Related_id')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 退款 + $(document).on('click', '.btn-refund', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入退款金额'), formType: 0}, function (value, index) { + var amount = parseFloat(value); + if (!amount || amount <= 0) { + Layer.msg(__('退款金额需大于 0')); + return; + } + Layer.prompt({title: __('请输入退款原因(可选)'), formType: 2}, function (reason, index2) { + Fast.api.ajax({ + url: 'fc/order/refund', + data: {ids: ids.join(','), amount: amount, reason: reason} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index2); + }); + Layer.close(index); + }); + }); + + // 补单 + $(document).on('click', '.btn-supplement', function () { + Layer.prompt({title: __('请输入需要补单的订单号'), formType: 0}, function (value, index) { + Fast.api.ajax({ + url: 'fc/order/supplement', + data: {orderNo: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/payview.js b/public/assets/js/backend/fc/payview.js new file mode 100644 index 0000000..67186a1 --- /dev/null +++ b/public/assets/js/backend/fc/payview.js @@ -0,0 +1,56 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/payview/index' + location.search, + add_url: 'fc/payview/add', + edit_url: 'fc/payview/edit', + del_url: 'fc/payview/del', + multi_url: 'fc/payview/multi', + import_url: 'fc/payview/import', + table: 'fc_pay_view', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'post_id', title: __('Post_id')}, + {field: 'pay_type', title: __('Pay_type'), operate: 'LIKE'}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'order_id', title: __('Order_id')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/plan.js b/public/assets/js/backend/fc/plan.js new file mode 100644 index 0000000..3bcdbc4 --- /dev/null +++ b/public/assets/js/backend/fc/plan.js @@ -0,0 +1,62 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/plan/index' + location.search, + add_url: 'fc/plan/add', + edit_url: 'fc/plan/edit', + del_url: 'fc/plan/del', + multi_url: 'fc/plan/multi', + import_url: 'fc/plan/import', + table: 'fc_plan', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'sort', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'plan_code', title: __('Plan_code'), operate: 'LIKE'}, + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'price', title: __('Price'), operate:'BETWEEN'}, + {field: 'origin_price', title: __('Origin_price'), operate:'BETWEEN'}, + {field: 'days', title: __('Days')}, + {field: 'tag', title: __('Tag'), operate: 'LIKE', formatter: Table.api.formatter.flag}, + {field: 'sort', title: __('Sort')}, + {field: 'enabled', title: __('Enabled')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/post.js b/public/assets/js/backend/fc/post.js new file mode 100644 index 0000000..17c7c0b --- /dev/null +++ b/public/assets/js/backend/fc/post.js @@ -0,0 +1,184 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/post/index' + location.search, + add_url: 'fc/post/add', + edit_url: 'fc/post/edit', + del_url: 'fc/post/del', + multi_url: 'fc/post/multi', + import_url: 'fc/post/import', + table: 'fc_post', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'category_id', title: __('Category_id')}, + {field: 'title', title: __('Title'), operate: 'LIKE'}, + {field: 'cover', title: __('Cover'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'price', title: __('Price'), operate:'BETWEEN'}, + {field: 'price_unit', title: __('Price_unit'), operate: 'LIKE'}, + {field: 'area', title: __('Area'), operate: 'LIKE'}, + {field: 'address', title: __('Address'), operate: 'LIKE'}, + {field: 'contact', title: __('Contact'), operate: 'LIKE'}, + {field: 'phone', title: __('Phone'), operate: 'LIKE'}, + {field: 'wechat', title: __('Wechat'), operate: 'LIKE'}, + {field: 'tags', title: __('Tags'), operate: 'LIKE', formatter: Table.api.formatter.flag}, + {field: 'is_paid', title: __('Is_paid')}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'pay_type', title: __('Pay_type'), operate: 'LIKE'}, + {field: 'audit_status', title: __('Audit_status')}, + {field: 'audit_reason', title: __('Audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'views', title: __('Views')}, + {field: 'likes', title: __('Likes')}, + {field: 'comment_count', title: __('Comment_count')}, + {field: 'status', title: __('Status')}, + {field: 'is_top', title: __('Is_top')}, + {field: 'distance', title: __('Distance')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 审核通过 + $(document).on('click', '.btn-audit-pass', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认审核通过选中的信息?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/post/audit', + data: {ids: ids.join(','), auditStatus: 1} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 审核驳回 + $(document).on('click', '.btn-audit-reject', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) { + Fast.api.ajax({ + url: 'fc/post/audit', + data: {ids: ids.join(','), auditStatus: 2, reason: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 下架 + $(document).on('click', '.btn-offline', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认下架选中的信息?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/post/offline', + data: {ids: ids.join(',')} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'fc/post/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'title', title: __('Title'), align: 'left'}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'fc/post/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'fc/post/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/report.js b/public/assets/js/backend/fc/report.js new file mode 100644 index 0000000..54695b1 --- /dev/null +++ b/public/assets/js/backend/fc/report.js @@ -0,0 +1,74 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/report/index' + location.search, + add_url: 'fc/report/add', + edit_url: 'fc/report/edit', + del_url: 'fc/report/del', + multi_url: 'fc/report/multi', + import_url: 'fc/report/import', + table: 'fc_report', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'target_type', title: __('Target_type'), operate: 'LIKE'}, + {field: 'target_id', title: __('Target_id')}, + {field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'reporter_id', title: __('Reporter_id')}, + {field: 'status', title: __('Status'), searchList: {"16":__('Status 16')}, formatter: Table.api.formatter.status}, + {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 处理 + $(document).on('click', '.btn-handle', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入处理备注(可选)'), formType: 2}, function (value, index) { + Fast.api.ajax({ + url: 'fc/report/handle', + data: {ids: ids.join(','), remark: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/userext.js b/public/assets/js/backend/fc/userext.js new file mode 100644 index 0000000..4c0141f --- /dev/null +++ b/public/assets/js/backend/fc/userext.js @@ -0,0 +1,65 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/userext/index' + location.search, + add_url: 'fc/userext/add', + edit_url: 'fc/userext/edit', + del_url: 'fc/userext/del', + multi_url: 'fc/userext/multi', + import_url: 'fc/userext/import', + table: 'fc_user_ext', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'openid', title: __('Openid'), operate: 'LIKE'}, + {field: 'user_type', title: __('User_type')}, + {field: 'realname_status', title: __('Realname_status')}, + {field: 'is_member', title: __('Is_member')}, + {field: 'member_level', title: __('Member_level'), operate: 'LIKE'}, + {field: 'member_expiretime', title: __('Member_expiretime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'invite_code', title: __('Invite_code'), operate: 'LIKE'}, + {field: 'inviter_id', title: __('Inviter_id')}, + {field: 'free_view_date', title: __('Free_view_date'), operate: 'LIKE'}, + {field: 'free_view_used', title: __('Free_view_used')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/fc/withdraw.js b/public/assets/js/backend/fc/withdraw.js new file mode 100644 index 0000000..6aefb12 --- /dev/null +++ b/public/assets/js/backend/fc/withdraw.js @@ -0,0 +1,92 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'fc/withdraw/index' + location.search, + add_url: 'fc/withdraw/add', + edit_url: 'fc/withdraw/edit', + del_url: 'fc/withdraw/del', + multi_url: 'fc/withdraw/multi', + import_url: 'fc/withdraw/import', + table: 'fc_withdraw', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'withdraw_no', title: __('Withdraw_no'), operate: 'LIKE'}, + {field: 'user_id', title: __('User_id')}, + {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, + {field: 'channel', title: __('Channel'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"16":__('Status 16')}, formatter: Table.api.formatter.status}, + {field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + // 打款 + $(document).on('click', '.btn-pay', function () { + var ids = Table.api.selectedids(table); + Layer.confirm(__('确认对选中的提现申请打款?'), {icon: 3, title: __('提示')}, function (index) { + Fast.api.ajax({ + url: 'fc/withdraw/pay', + data: {ids: ids.join(','), op: 'pay'} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + // 驳回 + $(document).on('click', '.btn-reject', function () { + var ids = Table.api.selectedids(table); + Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) { + Fast.api.ajax({ + url: 'fc/withdraw/pay', + data: {ids: ids.join(','), op: 'reject', reason: value} + }, function (data) { + table.bootstrapTable('refresh'); + return false; + }); + Layer.close(index); + }); + }); + + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +});