moonsflyer 2 月之前
父节点
当前提交
2ff411aad0

+ 0 - 230
app/admin/controller/bargain/Bargain.php

@@ -1,230 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\bargain;
-
-use app\admin\logic\bargain\BargainLogic;
-use app\common\server\ConfigServer;
-use app\common\server\JsonServer;
-use app\common\basics\AdminBase;
-use app\admin\validate\BargainValidate;
-use think\facade\View;
-
-/**
- * Class Bargain
- * @package app\admin\controller\bargain
- */
-class Bargain extends AdminBase
-{
-
-    /**
-     * @notes 砍价活动商品列表
-     * @return string|\think\response\Json
-     * @author suny
-     * @date 2021/7/13 6:59 下午
-     */
-    public function activity()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = BargainLogic::activity($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-        $num = BargainLogic::getNum();
-        View::assign('num', $num);
-        return View::fetch('bargain/activity');
-    }
-
-    /**
-     * @notes 砍价活动商品审核
-     * @return \think\response\Json|\think\response\View
-     * @author suny
-     * @date 2021/7/13 6:59 下午
-     */
-    public function audit()
-    {
-
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new BargainValidate())->goCheck('audit', $post);
-            $result = BargainLogic::audit($post);
-            if ($result) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error('操作失败');
-        }
-        $id = $this->request->get('id');
-        View::assign('id', $id);
-        return View('bargain/audit');
-    }
-
-
-    /**
-     * @notes 违规操作
-     * @return \think\response\Json|\think\response\View
-     * @author suny
-     * @date 2021/7/13 6:59 下午
-     */
-    public function violation()
-    {
-
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $id = $post['id'];
-            (new BargainValidate())->goCheck('violation', $post);
-            $result = BargainLogic::violation($post);
-            if ($result) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error('操作失败');
-        }
-        $id = $this->request->get('id');
-        View::assign('id', $id);
-        return View('bargain/violation');
-    }
-
-    /**
-     * @notes 砍价商品详情
-     * @return \think\response\View
-     * @author suny
-     * @date 2021/7/13 6:59 下午
-     */
-    public function bargain_detail()
-    {
-
-        $get = $this->request->get();
-        $detail = BargainLogic::detail($get);
-        View::assign('detail', $detail);
-        return View('bargain/bargain_detail');
-    }
-
-    /**
-     * @notes 切换状态
-     * @return \think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function switchStatus()
-    {
-
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            if (BargainLogic::switchStatus($post)) {
-                return JsonServer::success('更新成功');
-            } else {
-                $error = BargainLogic::getError() ?? '更新失败';
-                return JsonServer::error($error);
-            }
-        }
-    }
-
-    /**
-     * @notes 砍价记录列表
-     * @return string|\think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function launch()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = BargainLogic::getLaunch($get);
-            if (false === $lists) {
-                return JsonServer::error('结束时间必须大于开始时间!');
-            } else {
-                return JsonServer::success('OK', $lists);
-            }
-        }
-
-        $bargain_id = $this->request->get('bargain_id', 0);
-        View::assign('bargain_id', $bargain_id);
-        return View::fetch('bargain/launch');
-    }
-
-    /**
-     * @notes 砍价记录详情
-     * @return string
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function detail()
-    {
-
-        $id = $this->request->get('id');
-        $detail = BargainLogic::getLaunchDetail($id);
-        View::assign('detail', $detail);
-        return View::fetch('bargain/detail');
-    }
-
-    /**
-     * @notes 砍价订单记录
-     * @return \think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function knifeOrderRecord()
-    {
-
-        $launch_id = $this->request->get('launch_id');
-        $get = $this->request->get();
-        $lists = BargainLogic::getKnifeOrderRecord($launch_id, $get);
-        return JsonServer::success('获取成功', $lists);
-    }
-
-    /**
-     * @notes 砍价助力记录
-     * @return \think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function knifeRecord()
-    {
-
-        $launch_id = $this->request->get('launch_id');
-        $get = $this->request->get();
-        $lists = BargainLogic::getKnifeRecord($launch_id, $get);
-        return JsonServer::success('获取成功', $lists);
-    }
-
-    /**
-     * @notes 砍价设置
-     * @return string|\think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:00 下午
-     */
-    public function set()
-    {
-
-        if ($this->request->isAjax()) {
-            $payment_limit_time = $this->request->post('payment_limit_time', 0);
-            try {
-                ConfigServer::set('bargain', 'payment_limit_time', $payment_limit_time);
-            } catch (\Exception $e) {
-                return JsonServer::error('设置失败');
-            }
-            return JsonServer::success('设置成功');
-        }
-        $payment_limit_time = ConfigServer::get('bargain', 'payment_limit_time', 0);
-        View::assign('payment_limit_time', $payment_limit_time);
-        return View::fetch('bargain/set');
-    }
-}

+ 0 - 433
app/admin/logic/bargain/BargainLogic.php

@@ -1,433 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\bargain;
-
-
-use app\admin\controller\finance\Shop;
-use app\common\basics\Logic;
-use app\common\model\shop\Shop as ShopModel;
-use app\common\model\bargain\Bargain;
-use app\common\model\bargain\BargainItem;
-use app\common\model\bargain\BargainKnife;
-use app\common\model\bargain\BargainLaunch;
-use app\common\model\goods\Goods as GoodsModel;
-use app\common\model\order\Order;
-use app\common\model\team_activity\TeamActivity as TeamActivityModel;
-use app\common\model\user\User;
-use app\common\server\UrlServer;
-use think\facade\Db;
-use think\Exception;
-
-/**
- * Class BargainLogic
- * @package app\admin\logic\bargain
- */
-class BargainLogic extends Logic
-{
-    protected static $error; //错误信息
-
-    /**
-     * @notes 砍价活动列表
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 9:57 上午
-     */
-    public static function activity($get)
-    {
-
-        $where = [
-            ['del', '=', 0],
-        ];
-
-        // 查询条件
-
-        if (!empty($get['shop_name']) and $get['shop_name'] !== '') {
-            $shopModel = new ShopModel();
-            $ids = $shopModel->field('id,name')->where([
-                ['name', 'like', '%' . $get['shop_name'] . '%']
-            ])->column('id');
-
-            $where[] = ['shop_id', 'in', $ids];
-        }
-
-        if (!empty($get['goods_name']) and $get['goods_name'] !== '') {
-            $goodsModel = new GoodsModel();
-            $ids = $goodsModel->field('id,name')->where([
-                ['name', 'like', '%' . $get['goods_name'] . '%']
-            ])->column('id');
-
-            $where[] = ['goods_id', 'in', $ids];
-        }
-
-        if (isset($get['status']) and is_numeric($get['status'])) {
-            $where[] = ['status', '=', (int)$get['status']];
-        }
-
-        //审核状态
-        if (isset($get['type']) && $get['type'] != "") {
-            $where[] = ['audit_status', '=', $get['type']];
-        }
-
-        $bargainModel = new Bargain();
-        $count = $bargainModel->where($where)->count('id');
-        $lists = $bargainModel->field(true)
-            ->where($where)
-            ->with(['goods', 'shop'])
-            ->withCount(['launchPeopleNumber', 'successKnifePeopleNumber'])
-            ->page($get['page'], $get['limit'])
-            ->select();
-
-        foreach ($lists as &$item) {
-            $item['goods']['image'] = UrlServer::getFileUrl($item['goods']['image']);
-            $item['activity_start_time'] = date('Y-m-d H:i:s', $item['activity_start_time']);
-            $item['activity_end_time'] = date('Y-m-d H:i:s', $item['activity_end_time']);
-        }
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 砍价活动审核
-     * @param $post
-     * @return Bargain
-     * @author suny
-     * @date 2021/7/14 9:57 上午
-     */
-    public static function audit($post)
-    {
-
-        $data = [
-            'audit_status' => $post['review_status'],
-            'audit_remark' => $post['description'],
-        ];
-        return Bargain::where(['id' => $post['id']])
-            ->update($data);
-    }
-
-    /**
-     * @notes 违规重审
-     * @param $post
-     * @return bool
-     * @author suny
-     * @date 2021/7/14 9:58 上午
-     */
-    public static function violation($post)
-    {
-
-        try {
-            $data = [
-                'audit_status' => 2,
-                'audit_remark' => $post['description'],
-            ];
-            Bargain::where(['id' => $post['id']])
-                ->update($data);
-            BargainLaunch::where(['bargain_id' => $post['id']])
-                ->update(['status' => 2]);//砍失败
-            return true;
-        } catch (Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-    /**
-     * @notes 切换状态
-     * @param $post
-     * @return bool
-     * @throws \think\exception\PDOException
-     * @author suny
-     * @date 2021/7/14 9:58 上午
-     */
-    public static function switchStatus($post)
-    {
-
-        Db::startTrans();
-        try {
-            $bargainModel = new Bargain();
-            // 切换状态
-            $bargainModel->where(['id' => (int)$post['id']])
-                ->update([$post['field'] => $post['status']]);
-
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            static::$error = $e->getMessage();
-            Db::rollback();
-            return false;
-        }
-    }
-
-    /**
-     * @notes 砍价列表
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/14 9:58 上午
-     */
-    public static function getLaunch($get)
-    {
-
-        // 查询条件
-        $where = [];
-
-        //砍价订单编号bargain_sn
-        if (isset($get['bargain_sn']) and $get['bargain_sn']) {
-            $where[] = ['bargain_sn', '=', (int)$get['bargain_sn']];
-        }
-
-        if (isset($get['goods_name']) and $get['goods_name'] !== '') {
-            $goodsModel = new GoodsModel();
-            $ids = $goodsModel->field('id,name')->where([
-                ['name', 'like', '%' . $get['goods_name'] . '%']
-            ])->column('id');
-
-            $where[] = ['goods_id', 'in', $ids];
-        }
-
-        if (isset($get['status']) and is_numeric($get['status'])) {
-            $where[] = ['status', '=', (int)$get['status']];
-        }
-
-        if (isset($get['launch_start_time']) and $get['launch_start_time'] !== '') {
-            $where[] = ['launch_start_time', '>=', strtotime($get['launch_start_time'])];
-        }
-
-        if (isset($get['launch_end_time']) and $get['launch_end_time'] !== '') {
-            $where[] = ['launch_end_time', '<=', strtotime($get['launch_end_time'])];
-        }
-
-        if (isset($get['keyword_type']) and $get['keyword_type'] !== '') {
-            if (isset($get['keyword']) and $get['keyword'] !== '') {
-                switch ($get['keyword_type']) {
-                    case 'sn':
-                        $uid = User::where('sn', '=', $get['keyword'])->column('id');
-                        $where[] = ['user_id', 'in', $uid];
-                        break;
-                    case 'nickname':
-                        $uid = User::where('nickname', 'like', '%' . $get['keyword'] . '%')->column('id');
-                        $where[] = ['user_id', 'in', $uid];
-                        break;
-                }
-            }
-        }
-
-        $model = new BargainLaunch();
-        $count = $model->where($where)->count('id');
-        $lists = $model->field(true)
-            ->where($where)
-            ->with(['user.level'])
-            ->order('id', 'desc')
-            ->page($get['page'], $get['limit'])
-            ->select()->toArray();
-
-        foreach ($lists as &$item) {
-            // 解决用户被删除及Indirect modification of overloaded element报错
-            if (empty($item['user'])) {
-                $user = [
-                    'avatar' => '',
-                    'sn' => '-',
-                    'nickname' => '-',
-                    'level' => [
-                        'name' => '-'
-                    ]
-                ];
-            } else {
-                $user = $item['user'];
-            }
-            $user['avatar'] = UrlServer::getFileUrl($user['avatar']);
-            $item['user'] = $user;
-            $item['launch_start_time'] = date('Y-m-d H:i:s', $item['launch_start_time']);
-            $item['launch_end_time'] = date('Y-m-d H:i:s', $item['launch_end_time']);
-            $item['status'] = BargainLaunch::getStatusDesc($item['status']);
-            $item['goods_image'] = $item['goods_snap']['image'] == "" ? $item['goods_snap']['goods_iamge'] : $item['goods_snap']['image'];
-        }
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 砍价订单详情
-     * @param $id
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 9:58 上午
-     */
-    public static function getLaunchDetail($id)
-    {
-
-        $model = new BargainLaunch();
-        $detail = $model->field(true)
-            ->where(['id' => (int)$id])
-            ->with(['user.level'])
-            ->find()->toArray();
-
-        $detail['domain'] = UrlServer::getFileUrl();
-        $detail['launch_start_time'] = date('Y-m-d H:i:s', $detail['launch_start_time']);
-        $detail['launch_end_time'] = date('Y-m-d H:i:s', $detail['launch_end_time']);
-        $detail['payment_where'] = $detail['bargain_snap']['payment_where'] == 1 ? '任意金额购买' : '固定金额购买';
-        $detail['status'] = BargainLaunch::getStatusDesc($detail['status']);
-        return $detail;
-    }
-
-    /**
-     * @notes 砍价订单
-     * @param $launch_id
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 9:59 上午
-     */
-    public static function getKnifeOrderRecord($launch_id, $get)
-    {
-
-        $model = new BargainLaunch();
-        $count = $model->where(['id' => (int)$launch_id])
-            ->where('order_id', '>', 0)->count('id');
-        $lists = $model->field(true)
-            ->where(['id' => (int)$launch_id])
-            ->where('order_id', '>', 0)
-            ->with(['user.level', 'order'])
-            ->page($get['page'], $get['limit'])
-            ->select();
-
-        foreach ($lists as &$item) {
-            $item['user']['avatar'] = UrlServer::getFileUrl($item['user']['avatar']);
-            $item['order_status'] = Order::getOrderStatus($item['order']['order_status']);
-        }
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 砍价记录
-     * @param $launch_id
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 9:59 上午
-     */
-    public static function getKnifeRecord($launch_id, $get)
-    {
-
-        $model = new BargainKnife();
-
-        $count = $model->where(['launch_id' => (int)$launch_id])->count();
-        $lists = $model->field(true)
-            ->where(['launch_id' => (int)$launch_id])
-            ->with(['user.level'])
-            ->page($get['page'], $get['limit'])
-            ->select();
-
-        foreach ($lists as &$item) {
-            $item['user']['avatar'] = UrlServer::getFileUrl($item['user']['avatar']);
-            $item['help_time'] = date('Y-m-d H:i:s', $item['help_time']);
-            $item['help_price'] = '¥' . $item['help_price'];
-            $item['surplus_price'] = '¥' . $item['surplus_price'];
-        }
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 砍价详情
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 9:59 上午
-     */
-    public static function detail($get)
-    {
-
-        $where = [];
-        $where['b.id'] = $get['id'];
-        $info = Bargain::alias('b')
-            ->join('goods g', 'b.goods_id = g.id')
-            ->join('shop s', 's.id = b.shop_id')
-            ->where($where)
-            ->field('b.id,b.goods_id,b.audit_status,b.audit_remark,b.time_limit,b.payment_where,b.share_title,b.share_intro,g.image,g.name,g.min_price,g.max_price,s.id as sid,s.name as shop_name,s.type')
-            ->find()->toArray();
-
-        switch ($info['type']) {
-            case 1 :
-                $info['type'] = '官方自营';
-                break;
-            case 2 :
-                $info['type'] = '入驻商家';
-                break;
-        }
-
-        switch ($info['audit_status']) {
-            case 0 :
-                $info['audit_status'] = '待审核';
-                break;
-            case 1 :
-                $info['audit_status'] = '审核通过';
-                break;
-            case 2 :
-                $info['audit_status'] = '审核拒绝';
-                break;
-        }
-        $info['image'] = UrlServer::getFileUrl($info['image']);
-        return $info;
-    }
-
-    /**
-     * @notes 获取各列表数量
-     * @return array
-     * @author suny
-     * @date 2021/7/14 9:59 上午
-     */
-    public static function getNum()
-    {
-
-        $all = Bargain::where('del', 0)->count('id');
-        $unaudit = Bargain::where(['audit_status' => 0, 'del' => 0])->count('id');
-        $audit_pass = Bargain::where(['audit_status' => 1, 'del' => 0])->count('id');
-        $audit_refund = Bargain::where(['audit_status' => 2, 'del' => 0])->count('id');
-        $num = [
-            'all' => $all,
-            'unaudit' => $unaudit,
-            'audit_pass' => $audit_pass,
-            'audit_refund' => $audit_refund
-        ];
-        return $num;
-    }
-}

+ 0 - 99
app/admin/validate/BargainValidate.php

@@ -1,99 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\validate;
-
-use app\common\basics\Validate;
-
-/**
- * 砍价活动 数据校验
- * Class BargainValidate
- * @Author 张无忌
- * @package app\admin\validate
- */
-class BargainValidate extends Validate
-{
-    protected $rule = [
-        'id'                  => 'require|number',
-        'description'         => [ 'requireCallback' => 'checkRequireDescription' ],
-        'goods_id'            => 'require|number',
-        'time_limit'          => 'require',
-        'activity_start_time' => 'require',
-        'activity_end_time'   => 'require|endTime',
-        'payment_where'       => 'require|in:1,2',
-        'knife_type'          => 'require|in:1,2',
-        'status'              => 'require|in:0,1'
-    ];
-
-    protected $message = [
-        'id'         => 'ID不可为空',
-        'description'         => '请填写审核备注',
-        'id.number'  => 'ID必须为数字',
-        'goods_id.require'   => '未选择砍价商品',
-        'goods_id.number'    => '选择砍价商品异常',
-        'time_limit.require' => '请填写砍价活动有效期',
-        'time_limit.number'  => '砍价活动有效期必须为数字',
-        'activity_start_time.require' => '请选择活动开始时间',
-        'activity_end_time.require'   => '请选择活动结束时间',
-        'payment_where.require' => '请选择购买方式',
-        'payment_where.number'  => '选择的购买方式异常',
-        'knife_type.require'    => '请选择砍价金额方式',
-        'knife_type.number'     => '选择的砍价方式异常',
-        'status.require'        => '请选择砍价活动状态',
-        'status.in'             => '砍价状态选择异常',
-    ];
-
-    protected $scene = [
-        'add' => ['goods_id','time_limit','activity_start_time','activity_end_time','payment_where','knife_type','status'],
-        'edit' => ['id','goods_id','time_limit','activity_start_time','activity_end_time','payment_where','knife_type','status'],
-        'audit' => ['id','description'],
-        'violation' => ['id','description'],
-    ];
-
-    /**
-     * @notes 验证起始时间
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author suny
-     * @date 2021/7/14 10:11 上午
-     */
-    public function endTime($value, $rule, $data)
-    {
-        if (strtotime($value) <= time()) {
-            return '结束时间不能少于当前时间';
-        }
-        if (strtotime($value) <= strtotime($data['activity_start_time'])) {
-            return '结束时间不能少于或等于开始时间';
-        }
-
-        return true;
-    }
-    
-    function checkRequireDescription($value, $data)
-    {
-        if ($this->currentScene == 'audit' && $data['review_status'] == 1) {
-            return false;
-        }
-        
-        return true;
-    }
-}

+ 0 - 391
app/admin/view/bargain/activity.html

@@ -1,391 +0,0 @@
-{layout name="layout1" /}
-<style> .layui-table-cell { height: auto; } </style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*设置参与砍价活动的商品。</p>
-                        <p>*生效的砍价活动商品需要满足两个条件,一是开启活动,二是在活动有效期内。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索模块 -->
-        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="shop_name" class="layui-form-label">商家名称:</label>
-                    <div class="layui-input-block">
-                        <input type="text" id="shop_name" name="shop_name" placeholder="请输入" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="goods_name" class="layui-form-label">商品名称:</label>
-                    <div class="layui-input-block">
-                        <input type="text" id="goods_name" name="goods_name" placeholder="请输入" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label for="status" class="layui-form-label">砍价状态:</label>
-                    <div class="layui-input-inline">
-                        <select name="status" id="status" >
-                            <option value="">全部</option>
-                            <option value="1">已开启</option>
-                            <option value="0">已关闭</option>
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <button class="layui-btn layui-btn-sm  layuiadmin-btn-article {$view_theme_color}" lay-submit lay-filter="list-search">
-                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
-                    </button>
-                    <button class="layui-btn layui-btn-sm layui-btn-primary layuiadmin-btn-article }" lay-submit lay-filter="list-clear-search">重置</button>
-                </div>
-            </div>
-        </div>
-
-        <!-- 数据表格 -->
-        <div class="layui-card-body">
-            <div class="layui-tab" lay-filter="lists-tab">
-                <ul class="layui-tab-title">
-                    <ul class="layui-tab-title">
-                    <li class="layui-this" data-type="">全部({$num.all})</li>
-                    <li data-type="0">待审核商品({$num.unaudit})</li>
-                    <li data-type="1">审核通过商品({$num.audit_pass})</li>
-                    <li data-type="2">审核拒绝商品({$num.audit_refund})</li>
-                </ul>
-            </div>
-            <table id="table-lists" lay-filter="table-lists"></table>
-            <!--商家信息-->
-            <script type="text/html" id="table-shop">
-                <div>
-                    <img src="{{d.shop.logo}}" alt="图片" style="width:60px;height:60px;float:left;" class="image-show">
-                    <div style="margin-left:5px; width:150px;height:60px;white-space:normal;float: left;">{{d.shop.name}}</div>
-                </div>
-            </script>
-            <!--商品信息-->
-            <script type="text/html" id="table-goods">
-                <div>
-                    <img src="{{d.goods.image}}" alt="图片" style="width:60px;height:60px;float:left;" class="image-show">
-                    <div style="margin-left:5px; width:150px;height:60px;white-space:normal;float: left;">{{d.goods.name}}</div>
-                </div>
-            </script>
-            <script type="text/html" id="table-cost_price">
-                ¥{{d.goods.min_price}} ~ ¥{{d.goods.max_price}}
-            </script>
-            <script type="text/html" id="table-floor_price">
-                ¥{{d.bargain_min_price}} ~ ¥{{d.bargain_max_price}}
-            </script>
-            <script type="text/html" id="table-activity_time">
-                {{d.activity_start_time}} ~ {{d.activity_end_time}}
-            </script>
-            <script type="text/html" id="table-status">
-                {{#  if(d.status){ }}
-                进行中
-                {{#  } }}
-                {{#  if(!d.status){ }}
-                已停止
-                {{#  } }}
-            </script>
-            <script type="text/html" id="operation">
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="detail"><i class="layui-icon"></i>详情</a>
-                {{# if(0 == d.audit_status){ }}
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="audit"><i class="layui-icon"></i>审核</a>
-                {{# } }}
-                {{# if(1 == d.audit_status){ }}
-                <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="lists">砍价记录</a>
-                <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="violation"><i class="layui-icon"></i>违规重审</a>
-                {{# } }}
-
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/'
-    }).extend({
-        index: 'lib/index'
-    }).use(['index', 'table', 'like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like
-            ,element = layui.element;
-
-        //监听搜索
-        form.on('submit(list-search)', function(data){
-            var field = data.field;
-            //执行重载
-            table.reload('table-lists', {
-                where: field
-            });
-        });
-        //清空查询
-        form.on('submit(list-clear-search)', function () {
-            $('#status').val('');
-            $('#goods_name').val('');
-            $('#shop_name').val('');
-            form.render('select');
-            //刷新列表
-            table.reload('table-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                },
-            });
-        });
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(lists-tab)', function (data) {
-            $('#shop_name').val('');
-            $('#goods_name').val('');
-            $('#status').val('');
-            form.render('select');
-            var type = $(this).attr('data-type');
-            getList(type);
-        });
-
-        // 渲染数据表格
-        function getList(type) {
-            table.render({
-                elem: '#table-lists'
-                ,url: '{:url("bargain.Bargain/activity")}?type=' + type
-                ,cols: [[
-                    {field: 'id', title: 'ID',width:60, align:"center"}
-                    ,{field: 'shop', title: '商家',width:160, templet: '#table-shop'}
-                    ,{field: 'goods', title: '商品',width:160, templet: '#table-goods'}
-                    ,{field: 'cost_price', title: '原价',width:140, align: 'center', templet: '#table-cost_price'}
-                    ,{field: 'floor_price', title: '底价',width:140, align: 'center', templet: '#table-floor_price'}
-                    ,{field: 'launch_people_number_count', title: '发起砍价人数', width:120, align: 'center'}
-                    ,{field: 'success_knife_people_number_count', title: '砍价成功人数', width:120, align: 'center'}
-                    ,{field: 'activity_time', title: '活动有效期', width:320, align: 'center', templet: '#table-activity_time'}
-                    ,{field: 'status', title: '状态', width:100, align: 'center', templet: '#table-status'}
-                    ,{fixed: 'right', title: '操作', width:300, align: 'center', toolbar: '#operation'}
-                ]]
-                ,page:true
-                ,text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1
-                }
-                ,parseData: function(res){
-                    return {
-                        "code":res.code,
-                        "msg":res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists
-                    };
-                }
-                ,done: function(){
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-
-        // 事件
-        var active = {
-            lists: function (obj) {
-                layer.open({
-                    type: 2
-                    ,title: '砍价记录'
-                    ,content: '{:url("bargain.Bargain/launch")}?bargain_id='+obj.data.id
-                    ,area: ['90%','90%']
-                });
-            },
-            audit:function (obj) {
-                var id = obj.data.id;
-                console.log(obj.data)
-                layer.open({
-                    type: 2
-                    ,title: '审核'
-                    ,content: '{:url("bargain.bargain/audit")}?id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'addSubmit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("bargain.bargain/audit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('table-lists');
-                                    }
-                                }
-                            });
-                        });
-
-                        submit.trigger('click');
-                    }
-                })
-            },
-            violation: function (obj) {
-                var id = obj.data.id;
-                console.log(obj.data)
-                layer.open({
-                    type: 2
-                    ,title: '违规重审'
-                    ,content: '{:url("bargain.bargain/violation")}?id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'addSubmit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("bargain.bargain/violation")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('table-lists');
-                                    }
-                                }
-                            });
-                        });
-
-                        submit.trigger('click');
-                    }
-                })
-            },
-            detail: function (obj) {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '砍价活动商品详情'
-                    ,content: '{:url("bargain.bargain/bargain_detail")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'edit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        submit.trigger('click');
-                    }
-                })
-            },
-            // 切换状态
-            switchStatus: function (obj) {
-                if (obj.status) {
-                    var endTime = Date.parse(new Date(obj.endTime)) / 1000;
-                    var curTime = Date.parse(new Date()) / 1000;
-                    if (endTime <= curTime) {
-                        layui.layer.msg('砍价时间已过,请重新修改活动时间后再开启!', {time: 1000});
-                        table.reload('table-lists', {where: []});
-                        return false;
-                    }
-                    like.ajax({
-                        url:'{:url("bargain.Bargain/switchStatus")}',
-                        data:obj,
-                        type:"post",
-                        success:function(res) {
-                            if(res.code === 1) {
-                                layui.layer.msg(res.msg, { offset:'15px', icon:1, time:1000 });
-                                table.reload('table-lists', { where: [] });
-                            }
-                        }
-                    });
-                } else {
-                    layer.confirm('您确定要关闭该砍价活动吗?', {
-                        btn: ['确定','取消']
-                    }, function(){
-                        like.ajax({
-                            url:'{:url("bargain.Bargain/switchStatus")}',
-                            data:obj,
-                            type:"post",
-                            success:function(res) {
-                                if(res.code === 1) {
-                                    layui.layer.msg(res.msg, { offset:'15px', icon:1, time:1000 });
-                                    table.reload('table-lists', { where: [] });
-                                }
-                            }
-                        });
-                    }, function(){
-                        table.reload('table-lists', {where: []});
-                    });
-                }
-            }
-        };
-
-        // 监听表格右侧工具条
-        table.on('tool(table-lists)', function(obj){
-            var type = obj.event;
-            active[type] ? active[type].call(this, obj) : '';
-        });
-
-        // 切换状态
-        form.on('switch(switch-status)',function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var fields = obj.elem.attributes['data-field'].nodeValue;
-            var status = this.checked ? 1 : 0;
-            var endTime = obj.elem.attributes['data-end-time'].nodeValue;
-
-            var data = {"id":id, "field":fields, "status":status, endTime:endTime};
-            active['switchStatus'] ? active['switchStatus'].call(this, data) : '';
-        });
-
-        // 绑定点击按钮事件
-        $('.layui-btn.layuiadmin-btn').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-        //监听搜索
-        form.on('submit(search)', function(data){
-            var field = data.field;
-            table.reload('table-lists', {
-                where: field,
-                page: { curr: 1 }
-            });
-        });
-
-        // 监听重置搜素
-        form.on('submit(clear-search)', function(){
-            $('#shop_name').val('');
-            $('#goods_name').val('');
-            $('#status').val('');
-            form.render('select');
-            table.reload('table-lists', { where: [] });
-        });
-
-        // 图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src);
-        });
-    });
-</script>

+ 0 - 279
app/admin/view/bargain/add.html

@@ -1,279 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .layui-form-label {
-        width: 110px;
-    }
-</style>
-
-<div class="layui-card layui-form">
-    <div class="layui-card-body">
-        <!-- 选择商品 -->
-        <div class="layui-form-item">
-            <label class="layui-form-label"><font color="red">*</font>砍价商品:</label>
-            <div class="layui-input-block">
-                <a class="layui-btn layui-btn-normal select-goods">选择砍价商品</a>
-            </div>
-        </div>
-        <!-- 商品信息 -->
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="goods_info"></div>
-                <table id="goods_list" class="layui-table" lay-size="sm" style="display:none;width:630px;">
-                    <thead>
-                        <tr style="background-color: #f3f5f9">
-                            <th style="width: 120px;text-align: center">商品规格</th>
-                            <th style="width: 60px;text-align: center">商品价格</th>
-                            <th style="width: 40px;text-align: center">活动底价</th>
-                            <th style="width: 40px;text-align: center">首刀金额</th>
-                            <th style="width: 40px;text-align: center">商品库存</th>
-                        </tr>
-                    </thead>
-                    <tbody></tbody>
-                </table>
-            </div>
-        </div>
-
-        <!-- 砍价有效时长 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="time_limit" class="layui-form-label"><font color="red">*</font>砍价有效时长:</label>
-            <div class="layui-input-inline">
-                <input type="number" min="0" id="time_limit" name="time_limit" class="layui-input" autocomplete="off"
-                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                       lay-verType="tips" lay-verify="required|number|time_limit">
-            </div>
-            <div class="layui-form-mid layui-word-aux">小时</div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">本次发起砍价活动有效时长。</div>
-            </div>
-        </div>
-
-        <!-- 拼团活动时间 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label" style="width:110px;"><font color="red">*</font>砍价活动时间:</label>
-            <div class="layui-inline">
-                <div class="layui-input-inline">
-                    <input type="text" id="activity_start_time" name="activity_start_time" placeholder="开始时间" class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
-                </div>
-            </div>
-            <div class="layui-inline">
-                <div class="layui-input-inline">
-                    <input type="text" id="activity_end_time" name="activity_end_time" placeholder="结束时间" class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
-                </div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">本商品参与砍价活动的时间范围。</div>
-            </div>
-        </div>
-
-        <!-- 砍价分享标题 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="share_title" class="layui-form-label" style="width:110px;">砍价分享标题:</label>
-            <div class="layui-input-inline" style="width: 300px;">
-                <input type="text" id="share_title" name="share_title" class="layui-input" autocomplete="off" lay-verType="tips">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">分享砍价活动时的标题,为空时默认使用商品标题</div>
-            </div>
-        </div>
-
-        <!-- 砍价分享简介 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="share_intro" class="layui-form-label" style="width:110px;">砍价分享简介:</label>
-            <div class="layui-input-inline" style="width: 300px;">
-                <input type="text" id="share_intro" name="share_intro" class="layui-input" autocomplete="off" lay-verType="tips">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">分享砍价活动时的简介,为空时默认使用商品简介</div>
-            </div>
-        </div>
-
-        <!-- 购买方式 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label"><font color="red">*</font>购买方式:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="payment_where" value="1" title="砍到指定底价才可购买" checked>
-                <input type="radio" name="payment_where" value="2" title="任意金额可购买">
-            </div>
-        </div>
-
-        <!-- 每刀金额 -->
-        <div class="layui-form-item">
-            <label class="layui-form-label"><font color="red">*</font>每刀金额:</label>
-            <div class="layui-input-block">
-                <div class="layui-inline">
-                    <input type="radio" name="knife_type" value="1" title="随机金额" checked>
-                </div>
-                <div class="layui-inline">
-                    <input type="text" name="min_knife_price" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="min_knife_price" style="width:100px;" placeholder="最小金额"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-                <div class="layui-inline"><span>~</span></div>
-                <div class="layui-inline">
-                    <input type="text" name="max_knife_price" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="max_knife_price" style="width:100px;" placeholder="最大金额"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-            </div>
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-inline">
-                    <input type="radio" name="knife_type" value="2" title="固定金额">
-                </div>
-                <div class="layui-inline">
-                    <input type="text" name="fixed_knife_price" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="fixed_knife_price" style="width:100px;" placeholder="元"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-            </div>
-        </div>
-
-        <!-- 活动状态 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label"><font color="red">*</font>活动状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="status" value="1" title="开启">
-                <input type="radio" name="status" value="0" title="关闭" checked>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">活动开启并且在砍价活动时间内才能发起新的砍价活动</div>
-            </div>
-        </div>
-
-        <!-- 确认按钮 -->
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index'
-    }).use(['index', 'form', 'like', 'laydate'], function() {
-        var $ = layui.$
-            , form = layui.form
-            , like = layui.like
-            , laydate = layui.laydate;
-
-        // 开始时间
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#activity_start_time'
-            ,trigger: 'click'
-        });
-
-        // 结束时间
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#activity_end_time'
-            ,trigger: 'click'
-        });
-
-        // 选择商品
-        $(document).on('click','.select-goods',function () {
-            layer.open({
-                type: 2
-                ,title: '选择商品'
-                ,content: '{:url("common/selectGoodsTwo")}'
-                ,area: ['90%', '90%']
-                ,btn: ['确认', '取消']
-                ,yes: function(index, layero){
-                    var data = window["layui-layer-iframe" + index].callbackdata();
-                    if(data.length){
-                        goods_ids = [];
-                        $('#goods_list tbody').remove();
-                    }
-                    data.forEach(function(item, index) {
-                        console.log(item);
-                        var goods_info_html = '<img src="'+item.image+'" alt="商品图片" style="width:80px;height:80px;">\n' +
-                                              '<span style="margin-left:5px;">'+item.name+'</span>\n' +
-                                              '<input type="hidden" name="goods_id" value="'+item.id+'">';
-                        $(".goods_info").html(goods_info_html);
-                        $("#goods_list").show();
-                        for(var i = 0; item.goods_item.length > i; i++){
-                            var goods_item = item.goods_item[i];
-                            if(goods_ids.indexOf(goods_item.id) === -1) {
-                                goods_ids.push(goods_item.id);
-                                var goods_html = '<tr>\n' +
-                                    '<td style="text-align: center">'+goods_item.spec_value_str+'</td>\n' +
-                                    '<td style="text-align: center">'+goods_item.price+'</td>\n' +
-                                    '<td style="width: 40px;"><input type="text" name=floor_price['+item.id+']['+goods_item.id+'] class="layui-input" autocomplete="off"\n' +
-                                    '                           onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')"></td>\n' +
-                                    '<td style="width: 40px;"><input type="text" name=first_knife_price['+item.id+']['+goods_item.id+'] class="layui-input" autocomplete="off"\n' +
-                                    '                           onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')"></td>\n' +
-                                    '<td style="width: 40px;text-align: center">'+item.stock+'</td>\n' +
-                                    '</tr>';
-                                $('#goods_list').append(goods_html);
-                            }
-                        }
-                    });
-                    $('.goods').show();
-                }
-            })
-        });
-
-        // 表单验证
-        form.verify({
-            min_knife_price: function(value){
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '1') {
-                    if (!value || value === '') {
-                        return '请填写最小砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '最小砍价金额不能小于0';
-                    }
-                }
-            },
-            max_knife_price: function(value){
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '1') {
-                    if (!value || value === '') {
-                        return '请填写最大砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '最大砍价金额不能小于0';
-                    }
-                }
-            },
-            fixed_knife_price: function (value) {
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '2') {
-                    if (!value || value === '') {
-                        return '请填写固定砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '固定砍价金额不能小于0';
-                    }
-                }
-            },
-            first_knife_price: function (value, that) {
-                var goods_price = $(that).parent().prev().prev().html();
-                if (parseFloat(value) > parseFloat(goods_price)) {
-                    return '首刀价格不能大于商品价格';
-                }
-            }
-        });
-
-    });
-</script>

+ 0 - 66
app/admin/view/bargain/audit.html

@@ -1,66 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block {
-        line-height: 38px;
-    }
-</style>
-<div class="layui-form" style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
-  <input type="hidden" name="id" value="{$id}" />
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现审核:</label>
-    <div class="layui-input-block">
-      <input type="radio" name="review_status" value="1" title="审核通过">
-      <input type="radio" name="review_status" value="2" title="审核拒绝" checked>
-    </div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"><font color="red">*</font>审核备注:</label>
-    <div class="layui-input-block">
-      <textarea name="description" placeholder="请输入内容" class="layui-textarea" style="width:380px;height:120px;"></textarea>
-    </div>
-  </div>
-
-  <div class="layui-form-item layui-hide">
-    <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-  </div>
-</div>
-
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like;
-      // 确认
-      form.on('submit(confirm)', function(data){
-        console.log(data.field)
-          // 审核
-          like.ajax({
-              url:'{:url("activity_area.goods/audit")}',
-              data:{'id':data.field.id,'review_status':data.field.review_status,'description': data.field.description},
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-      });
-      // 返回
-      form.on('submit(cancel)', function(data){
-        var index = parent.layer.getFrameIndex(window.name); 
-        parent.layer.close(index);
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-    });
-</script>

+ 0 - 101
app/admin/view/bargain/bargain_detail.html

@@ -1,101 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .div-flex {
-        display: flex;
-        align-items: center;
-        justify-content: left;
-    }
-    .width-160 {
-        width: 200px;
-    }
-    .layui-table th {
-        text-align: center;
-    }
-    .table-margin{
-        margin-left: 50px;
-        margin-right: 50px;
-        text-align: center;
-    }
-    .image{
-        height:80px;
-        width: 80px;
-    }
-
-    .mt50{
-        margin-left: 50px;
-    }
-
-</style>
-<div class="layui-card-body" >
-    <!--基本信息-->
-    <div class="layui-form" lay-filter="layuiadmin-form-after-sale" id="layuiadmin-form-after-sale" >
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>商家信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">商家编号:</label>
-            <div class="width-160">{$detail.sid}</div>
-            <label class="layui-form-label ">商家名称:</label>
-            <div class="width-160">{$detail.shop_name}</div>
-            <label class="layui-form-label ">商家类型:</label>
-            <div class="width-160 refund_type_text">{$detail.type}</div>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>商品信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">商品编号:</label>
-            <div class="width-160">{$detail.goods_id}</div>
-            <label class="layui-form-label ">商品名称:</label>
-            <div class="width-160">{$detail.name}</div>
-            <label class="layui-form-label ">商品图片:</label>
-            <img src="{$detail.image}" class="image-show image" width="60px" height="60px">
-            <label class="layui-form-label ">商品价格:</label>
-            <div class="width-160">¥{$detail.min_price}~¥{$detail.max_price}</div>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>砍价活动信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">分享标题:</label>
-            <div class="width-160">{$detail.share_title}</div>
-            <label class="layui-form-label ">分享简介:</label>
-            <div class="width-160">{$detail.share_intro}</div>
-            <label class="layui-form-label ">有效时间:</label>
-            <div class="width-160">{$detail.time_limit}小时</div>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>审核信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">审核状态:</label>
-            <div class="width-160">{$detail.audit_status}</div>
-            <label class="layui-form-label ">审核备注:</label>
-            <div class="width-160">{$detail.audit_remark}</div>
-        </div>
-
-    </div>
-</div>
-
-
-<script type="text/javascript">
-
-
-
-</script>

+ 0 - 222
app/admin/view/bargain/detail.html

@@ -1,222 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block { line-height: 38px; }
-    .layui-form-label { width: 100px; }
-</style>
-<div class="layui-fluid">
-    <div class="layui-card">
-
-        <div class="layui-form layui-card-body">
-            <!-- 发起人信息 -->
-            <div class="layui-form-item" style="margin-bottom:0;">
-                <span>发起人信息</span>
-            </div>
-            <div style="margin-left:30px">
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">会员编号:</label>
-                    <div class="layui-input-block">{$detail.user.sn}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">会员昵称:</label>
-                    <div class="layui-input-block">{$detail.user.nickname}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">手机号码:</label>
-                    <div class="layui-input-block">{$detail.user.mobile}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">会员等级:</label>
-                    <div class="layui-input-block">{$detail.user.level.name}</div>
-                </div>
-            </div>
-            <!-- 砍价信息 -->
-            <div class="layui-form-item" style="margin-bottom:0;">
-                <span>砍价信息</span>
-            </div>
-            <div style="margin-left:30px">
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">发起砍价时间:</label>
-                    <div class="layui-input-block">{$detail.launch_start_time}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">砍价有效期限:</label>
-                    <div class="layui-input-block">{$detail.launch_end_time}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">砍价商品:</label>
-                    <div class="layui-input-block">
-                        <img src="{$detail.goods_snap.image}" alt="图片" style="width:60px;height:60px;float:left;" class="image-show">
-                        <div class="layui-inline">
-                            <div>{$detail.goods_snap.name}</div>
-                            <div>{$detail.goods_snap.spec_value_str}&nbsp; ¥{$detail.goods_snap.price}</div>
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">活动底价:</label>
-                    <div class="layui-input-block">¥{$detail.bargain_price}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">购买方式:</label>
-                    <div class="layui-input-block">任意金额可购买</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">已砍次数:</label>
-                    <div class="layui-input-block">{$detail.help_number}</div>
-                </div>
-                <div class="layui-form-item" style="margin-bottom:0;">
-                    <label class="layui-form-label">砍价状态:</label>
-                    <div class="layui-input-block">{$detail.status}</div>
-                </div>
-            </div>
-
-            <!-- ===================砍价订单列表 ====================== -->
-            <div class="layui-form-item" style="margin:30px 0 10px 0;">
-                <span>砍价订单</span>
-            </div>
-            <div style="margin-left:30px">
-                <table id="table-lists-order" lay-filter="table-lists-order"></table>
-                <script type="text/html" id="table-goods-order">
-                    <div>
-                        <img src="{{d.goods_snap.image}}" alt="图片" style="width:60px;height:60px;float:left;" class="image-show">
-                        <div class="layui-inline">
-                            <div>{{d.goods_snap.name}}</div>
-                            <div>{{d.goods_snap.spec_value_str}}&nbsp; ¥{{d.goods_snap.price}}</div>
-                        </div>
-                    </div>
-                </script>
-                <script type="text/html" id="table-order_sn-order">
-                    {{#  if(d.order){ }} {{d.order.order_sn}} {{#  } }}
-                </script>
-                <script type="text/html" id="table-create_time-order">
-                    {{#  if(d.order){ }} {{d.order.create_time}} {{#  } }}
-                </script>
-                <script type="text/html" id="table-order_amount-order">
-                    {{#  if(d.order){ }} {{d.order.order_amount}} {{#  } }}
-                </script>
-                <script type="text/html" id="table-order_status-order">
-                    {{d.order_status}}
-                </script>
-                <!--会员信息-->
-                <script type="text/html" id="table-user-order">
-                    <div class="layui-input-inline"  style="text-align: left">
-                        {{#  if(d.user){ }}
-                        <img src="{{d.user.avatar}}" style="width: 80px; height: 80px;">
-                        <div class="layui-inline">
-                            <p>会员编号:{{d.user.sn}}</p>
-                            <p>会员昵称:{{d.user.nickname}}</p>
-                            <p>会员等级:{{d.user.level.name ?? '无'}}</p>
-                        </div>
-                        {{#  } }}
-                    </div>
-                </script>
-            </div>
-
-            <!-- ===================砍价记录列表 ====================== -->
-            <div class="layui-form-item" style="margin:30px 0 10px 0;">
-                <span>砍价记录</span>
-            </div>
-            <div style="margin-left:30px">
-                <table id="table-lists-knife" lay-filter="table-lists-knife"></table>
-                <!--会员信息-->
-                <script type="text/html" id="table-user-knife">
-                    <div class="layui-input-inline"  style="text-align: left">
-                        {{#  if(d.user){ }}
-                            <img src="{{d.user.avatar}}" style="width: 80px; height: 80px;">
-                            <div class="layui-inline">
-                                <p>会员编号:{{d.user.sn}}</p>
-                                <p>会员昵称:{{d.user.nickname}}</p>
-                                <p>会员等级:{{d.user.level.name ?? '无'}}</p>
-                            </div>
-                        {{#  } }}
-                    </div>
-                </script>
-            </div>
-
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src);
-        });
-
-        // 渲染数据表格
-        table.render({
-            elem: '#table-lists-order'
-            ,url: '{:url("bargain.Bargain/knifeOrderRecord")}?launch_id={$detail.id}'
-            ,cols: [[
-                {field: 'userInfo', title: '发起人',width:'20%', templet: '#table-user-order'}
-                ,{field: 'order_sn', title: '订单号', width:'20%', align: 'center', templet: '#table-order_sn-order'}
-                ,{field: 'goods', title: '商品信息',width:'20%', templet: '#table-goods-order'}
-                ,{field: 'create_time', title: '下单时间', width:'20%', align: 'center', templet: '#table-create_time-order'}
-                ,{field: 'order_amount', title: '下单金额', width:'10%', align: 'center', templet: '#table-order_amount-order'}
-                ,{field: 'order_status', title: '订单状态',width:'10%', align: 'center', templet: '#table-order_status-order'}
-            ]]
-            ,page:true
-            ,text: {none: '暂无数据!'}
-            ,response: {
-                statusCode: 1
-            }
-            ,parseData: function(res){
-                return {
-                    "code":res.code,
-                    "msg":res.msg,
-                    "count": res.data.count,
-                    "data": res.data.lists
-                };
-            }
-            ,done: function(res, curr, count){
-                $(".layui-table-main tr").each(function (index, val) {
-                    $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                    $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                });
-            }
-        });
-
-        table.render({
-            elem: '#table-lists-knife'
-            ,url: '{:url("bargain.Bargain/knifeRecord")}?launch_id={$detail.id}'
-            ,cols: [[
-                {field: 'userInfo', title: '会员信息',width:'25%', templet: '#table-user-knife'}
-                ,{field: 'help_price', title: '砍掉金额', width:'25%', align: 'center'}
-                ,{field: 'surplus_price', title: '剩余金额', width:'25%', align: 'center'}
-                ,{field: 'help_time', title: '砍价时间', width:'25%', align: 'center'}
-            ]]
-            ,page:true
-            ,text: {none: '暂无数据!'}
-            ,response: {
-                statusCode: 1
-            }
-            ,parseData: function(res){
-                return {
-                    "code":res.code,
-                    "msg":res.msg,
-                    "count": res.data.count,
-                    "data": res.data.lists
-                };
-            }
-            ,done: function(res, curr, count){
-                $(".layui-table-main tr").each(function (index, val) {
-                    $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                    $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                });
-            }
-        });
-
-    });
-</script>

+ 0 - 306
app/admin/view/bargain/edit.html

@@ -1,306 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .layui-form-label {
-        width: 110px;
-    }
-</style>
-
-<div class="layui-card layui-form">
-    <div class="layui-card-body">
-        <!-- 选择商品 -->
-        <input type="hidden" name="id" value="{$detail.id}">
-        <div class="layui-form-item">
-            <label class="layui-form-label"><font color="red">*</font>砍价商品:</label>
-            <div class="layui-input-block">
-                <a class="layui-btn layui-btn-normal select-goods">选择砍价商品</a>
-            </div>
-        </div>
-        <!-- 商品信息 -->
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="goods_info">
-                    {if $detail.is_goods_item}
-                    <img src="{$detail.goods.image}" alt="商品图片" style="width:80px;height:80px;">
-                    <span style="margin-left:5px;">{$detail.goods.name}</span>
-                    <input type="hidden" name="goods_id" value="{$detail.goods.id}">
-                    {/if}
-                </div>
-                <table id="goods_list" class="layui-table" lay-size="sm" style="width:630px;">
-                    <thead>
-                        <tr style="background-color: #f3f5f9">
-                            <th style="width: 120px;text-align: center">商品规格</th>
-                            <th style="width: 60px;text-align: center">商品价格</th>
-                            <th style="width: 40px;text-align: center">活动底价</th>
-                            <th style="width: 40px;text-align: center">首刀金额</th>
-                            <th style="width: 40px;text-align: center">商品库存</th>
-                        </tr>
-                    </thead>
-                    <tbody>
-                    {if $detail.is_goods_item}
-                        {volist name="$detail.item" id="vo"}
-                            <tr>
-                                <td style="text-align: center">{$vo.spec_value_str}</td>
-                                <td style="text-align: center">{$vo.spec_item_price}</td>
-                                <td style="width: 40px;">
-                                    <input onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')"
-                                           type="number" name=floor_price[{$detail.goods_id}][{$vo.spec_item_id}]
-                                           lay-verType="tips" lay-verify="required" autocomplete="off"
-                                           class="layui-input" value="{$vo.floor_price}">
-                                </td>
-                                <td style="width: 40px;">
-                                    <input onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')"
-                                           type="number" name=first_knife_price[{$detail.goods_id}][{$vo.spec_item_id}]
-                                           lay-verType="tips" lay-verify="required|first_knife_price" autocomplete="off"
-                                           class="layui-input" value="{$vo.first_knife_price}">
-                                </td>
-                                <td style="width: 40px;text-align: center;">{$vo.stock}</td>
-                            </tr>
-                        {/volist}
-                    {/if}
-                    </tbody>
-                </table>
-            </div>
-        </div>
-
-        <!-- 砍价有效时长 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="time_limit" class="layui-form-label"><font color="red">*</font>砍价有效时长:</label>
-            <div class="layui-input-inline">
-                <input type="number" min="0" id="time_limit" name="time_limit" value="{$detail.time_limit}" class="layui-input" autocomplete="off"
-                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                       lay-verType="tips" lay-verify="required|number|time_limit">
-            </div>
-            <div class="layui-form-mid layui-word-aux">小时</div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">本次发起砍价活动有效时长。</div>
-            </div>
-        </div>
-
-        <!-- 拼团活动时间 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label" style="width:110px;"><font color="red">*</font>砍价活动时间:</label>
-            <div class="layui-inline">
-                <div class="layui-input-inline">
-                    <input type="text" id="activity_start_time" name="activity_start_time" value="{$detail.activity_start_time}" placeholder="开始时间" class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
-                </div>
-            </div>
-            <div class="layui-inline">
-                <div class="layui-input-inline">
-                    <input type="text" id="activity_end_time" name="activity_end_time" value="{$detail.activity_end_time}" placeholder="结束时间" class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
-                </div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">本商品参与砍价活动的时间范围。</div>
-            </div>
-        </div>
-
-        <!-- 砍价分享标题 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="share_title" class="layui-form-label" style="width:110px;">砍价分享标题:</label>
-            <div class="layui-input-inline" style="width: 300px;">
-                <input type="text" id="share_title" name="share_title" value="{$detail.share_title}" class="layui-input" autocomplete="off" lay-verType="tips">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">分享砍价活动时的标题,为空时默认使用商品标题</div>
-            </div>
-        </div>
-
-        <!-- 砍价分享简介 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label for="share_intro" class="layui-form-label" style="width:110px;">砍价分享简介:</label>
-            <div class="layui-input-inline" style="width: 300px;">
-                <input type="text" id="share_intro" name="share_intro" value="{$detail.share_intro}" class="layui-input" autocomplete="off" lay-verType="tips">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label" style="width:110px;"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">分享砍价活动时的简介,为空时默认使用商品简介</div>
-            </div>
-        </div>
-
-        <!-- 购买方式 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label"><font color="red">*</font>购买方式:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="payment_where" value="1" title="砍到指定底价才可购买" {if $detail.payment_where == 1}checked{/if}>
-                <input type="radio" name="payment_where" value="2" title="任意金额可购买" {if $detail.payment_where == 2}checked{/if}>
-            </div>
-        </div>
-
-        <!-- 每刀金额 -->
-        <div class="layui-form-item">
-            <label class="layui-form-label"><font color="red">*</font>每刀金额:</label>
-            <div class="layui-input-block">
-                <div class="layui-inline">
-                    <input type="radio" name="knife_type" value="1" title="随机金额" {if $detail.knife_type == 1}checked{/if}>
-                </div>
-                <div class="layui-inline">
-                    <input type="text" name="min_knife_price" value="{$detail.min_knife_price}" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="min_knife_price" style="width:100px;" placeholder="最小金额"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-                <div class="layui-inline"><span>~</span></div>
-                <div class="layui-inline">
-                    <input type="text" name="max_knife_price" value="{$detail.max_knife_price}" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="max_knife_price" style="width:100px;" placeholder="最大金额"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-            </div>
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-inline">
-                    <input type="radio" name="knife_type" value="2" title="固定金额" {if $detail.knife_type == 2}checked{/if}>
-                </div>
-                <div class="layui-inline">
-                    <input type="text" name="fixed_knife_price" value="{$detail.fixed_knife_price}" class="layui-input" autocomplete="off"
-                           lay-verType="tips" lay-verify="fixed_knife_price" style="width:100px;" placeholder="元"
-                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
-                </div>
-            </div>
-        </div>
-
-        <!-- 活动状态 -->
-        <div class="layui-form-item" style="margin-bottom: 0;">
-            <label class="layui-form-label"><font color="red">*</font>活动状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="status" value="1" title="开启" {if $detail.status}checked{/if}>
-                <input type="radio" name="status" value="0" title="关闭" {if !$detail.status}checked{/if}>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block">
-                <div class="layui-form-mid layui-word-aux">活动开启并且在砍价活动时间内才能发起新的砍价活动</div>
-            </div>
-        </div>
-
-        <!-- 确认按钮 -->
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index'
-    }).use(['index', 'form', 'like', 'laydate'], function() {
-        var $ = layui.$
-            , form = layui.form
-            , like = layui.like
-            , laydate = layui.laydate;
-
-        // 开始时间
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#activity_start_time'
-            ,trigger: 'click'
-        });
-
-        // 结束时间
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#activity_end_time'
-            ,trigger: 'click'
-        });
-
-        // 选择商品
-        $(document).on('click','.select-goods',function () {
-            layer.open({
-                type: 2
-                ,title: '选择商品'
-                ,content: '{:url("common/selectGoodsTwo")}'
-                ,area: ['90%', '90%']
-                ,btn: ['确认', '取消']
-                ,yes: function(index, layero){
-                    var data = window["layui-layer-iframe" + index].callbackdata();
-                    if(data.length){
-                        goods_ids = [];
-                        $('#goods_list tbody').remove();
-                    }
-                    data.forEach(function(item, index) {
-                        console.log(item);
-                        var goods_info_html = '<img src="'+item.image+'" alt="商品图片" style="width:80px;height:80px;">\n' +
-                                              '<span style="margin-left:5px;">'+item.name+'</span>\n' +
-                                              '<input type="hidden" name="goods_id" value="'+item.id+'">';
-                        $(".goods_info").html(goods_info_html);
-                        $("#goods_list").show();
-                        for(var i = 0; item.goods_item.length > i; i++){
-                            var goods_item = item.goods_item[i];
-                            if(goods_ids.indexOf(goods_item.id) === -1) {
-                                goods_ids.push(goods_item.id);
-                                var goods_html = '<tr>\n' +
-                                    '<td style="text-align: center">'+goods_item.spec_value_str+'</td>\n' +
-                                    '<td style="text-align: center">'+goods_item.price+'</td>\n' +
-                                    '<td style="width: 40px;"><input onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')" type="number" name=floor_price['+item.id+']['+goods_item.id+'] lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input"></td>\n' +
-                                    '<td style="width: 40px;"><input onkeyup="value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, \'$1\')" type="number" name=first_knife_price['+item.id+']['+goods_item.id+'] lay-verType="tips" lay-verify="required|first_knife_price" autocomplete="off" class="layui-input"></td>\n' +
-                                    '<td style="width: 40px;text-align: center">'+item.stock+'</td>\n' +
-                                    '</tr>';
-                                $('#goods_list').append(goods_html);
-                            }
-                        }
-                    });
-                    $('.goods').show();
-                }
-            })
-        });
-
-        // 表单验证
-        form.verify({
-            min_knife_price: function(value){
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '1') {
-                    if (!value || value === '') {
-                        return '请填写最小砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '最小砍价金额不能小于0';
-                    }
-                }
-            },
-            max_knife_price: function(value){
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '1') {
-                    if (!value || value === '') {
-                        return '请填写最大砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '最大砍价金额不能小于0';
-                    }
-                }
-            },
-            fixed_knife_price: function (value) {
-                var type = $('input[name=knife_type]:checked').val();
-                if (type === '2') {
-                    if (!value || value === '') {
-                        return '请填写固定砍价金额';
-                    }
-                    if(parseFloat(value) < 0){
-                        return '固定砍价金额不能小于0';
-                    }
-                }
-            },
-            first_knife_price: function (value, that) {
-                var goods_price = $(that).parent().prev().prev().html();
-                if (parseFloat(value) > parseFloat(goods_price)) {
-                    return '首刀价格不能大于商品价格';
-                }
-            }
-        });
-
-    });
-</script>

+ 0 - 276
app/admin/view/bargain/launch.html

@@ -1,276 +0,0 @@
-{layout name="layout1" /}
-<style> .layui-table-cell { height: auto; } </style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        {if !$bargain_id}
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*砍价列表,查看帮砍人数,信息,砍价订单等信息;</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-        {/if}
-
-        <!-- 搜索模块 -->
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label for="bargain_sn" class="layui-form-label">砍价编号:</label>
-                            <div class="layui-input-block">
-                                <input type="text" id="bargain_sn" name="bargain_sn" placeholder="请输入" autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <label for="goods_name" class="layui-form-label">商品名称:</label>
-                            <div class="layui-input-block">
-                                <input type="text" id="goods_name" name="goods_name" placeholder="请输入" autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <label for="status" class="layui-form-label">砍价状态:</label>
-                            <div class="layui-input-inline">
-                                <select name="status" id="status" >
-                                    <option value="">全部</option>
-                                    <option value="0">砍价中</option>
-                                    <option value="1">砍价成功</option>
-                                    <option value="2">砍价失败</option>
-                                </select>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label for="keyword_type" class="layui-form-label">发起用户:</label>
-                            <div class="layui-input-block">
-                                <select id="keyword_type" name="keyword_type" >
-                                    <option value="">请选择</option>
-                                    <option value="sn">会员编号</option>
-                                    <option value="nickname">会员昵称</option>
-                                    <option value="mobile">手机号码</option>
-                                </select>
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" id="keyword" name="keyword" placeholder="请输入" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">发起时间:</label>
-                            <div class="layui-inline">
-                                <input type="text" id="launch_start_time" name="launch_start_time" placeholder="开始时间" autocomplete="off" class="layui-input">
-                            </div>
-                            <div class="layui-inline"> - </div>
-                            <div class="layui-inline">
-                                <input type="text" id="launch_end_time" name="launch_end_time" placeholder="结束时间" class="layui-input">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm  layuiadmin-btn-article {$view_theme_color}" lay-submit lay-filter="search">
-                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
-                            </button>
-                            <button class="layui-btn layui-btn-sm layui-btn-primary layuiadmin-btn-article }" lay-submit lay-filter="clear-search">重置</button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 数据表格 -->
-        <div class="layui-card-body">
-            <table id="table-lists" lay-filter="table-lists"></table>
-            <script type="text/html" id="table-user">
-                {{#  if((d.user) == null){ }}
-                        会员信息缺失
-                {{#  } else { }}
-                <img src="{{d.user.avatar}}" style="height:80px;width: 80px" class="image-show">
-                <div class="layui-input-inline"  style="text-align: left">
-                    <p>会员编号:{{d.user.sn}}</p>
-                    <p>会员昵称:{{d.user.nickname}}</p>
-                    <p>会员等级:{{d.user.level.name ?? '无'}}</p>
-                </div>
-                {{#  } }}
-            </script>
-            <script type="text/html" id="table-goods">
-                <div>
-                    <img src="{{d.goods_image}}" alt="图片" style="width:60px;height:60px;float:left;" class="image-show">
-                    <div class="layui-inline">
-                        <div >{{d.goods_snap.name}}</div>
-                        <div>{{d.goods_snap.spec_value_str}}&nbsp; ¥{{d.goods_snap.price}}</div>
-                    </div>
-                </div>
-            </script>
-            <script type="text/html" id="table-start_time">
-                <div style="width:100px;height:60px;white-space:normal;">
-                    {{d.launch_start_time}}
-                </div>
-            </script>
-            <script type="text/html" id="table-end_time">
-                <div style="width:100px;height:60px;white-space:normal;">
-                    {{d.launch_end_time}}
-                </div>
-            </script>
-
-            <script type="text/html" id="operation">
-                <a class="layui-btn layui-btn-normal layui-btn-sm " lay-event="detail">详情</a>
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like', 'laydate'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like
-            ,laydate = layui.laydate;
-
-        // 渲染数据表格
-        table.render({
-            elem: '#table-lists'
-            ,url: '{:url("bargain.Bargain/launch")}?bargain_id={$bargain_id}'
-            ,cols: [[
-                {field: 'id', title: '序号',width:60, align:"center"}
-                ,{field: 'bargain_sn', title: '砍价编号',width:160, align:"center"}
-                ,{field: 'user', title: '发起用户',width:300, templet: '#table-user'}
-                ,{field: 'goods', title: '砍价商品',width:250, templet: '#table-goods'}
-                ,{field: 'launchStartTime', title: '发起时间', width:120, align: 'center', templet: '#table-start_time'}
-                ,{field: 'launchEndTime', title: '结束时间', width:120, align: 'center', templet: '#table-end_time'}
-                ,{field: 'help_number', title: '已砍价次数', width:120, align: 'center'}
-                ,{field: 'current_price', title: '当前价格', width:120, align: 'center'}
-                ,{field: 'status', title: '砍价状态', width:100, align: 'center'}
-                ,{fixed: 'right', title: '操作', align: 'center', toolbar: '#operation',width:100}
-            ]]
-            ,page:true
-            ,text: {none: '暂无数据!'}
-            ,response: {
-                statusCode: 1
-            }
-            ,parseData: function(res){
-                return {
-                    "code":res.code,
-                    "msg":res.msg,
-                    "count": res.data.count,
-                    "data": res.data.lists
-                };
-            }
-            ,done: function(res, curr, count){
-                $(".layui-table-main tr").each(function (index, val) {
-                    $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                    $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                });
-            }
-        });
-
-        //事件
-        var active = {
-            detail: function (obj) {
-                layer.open({
-                    type: 2
-                    ,title: '砍价详情'
-                    ,content: '{:url("bargain.Bargain/detail")}?id='+obj.data.id
-                    ,area: ['90%','90%']
-                });
-            }
-        };
-
-        // 监听表格右侧工具条
-        table.on('tool(table-lists)', function(obj){
-            var type = obj.event;
-            active[type] ? active[type].call(this, obj) : '';
-        });
-
-        // 切换状态
-        form.on('switch(switch-status)',function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var fields = obj.elem.attributes['data-field'].nodeValue;
-            var status = this.checked ? 1 : 0;
-            var data = {"id":id, "field":fields, "status":status};
-            active['switchStatus'] ? active['switchStatus'].call(this, data) : '';
-        });
-
-        // 绑定点击按钮事件
-        $('.layui-btn.layuiadmin-btn').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src);
-        });
-        
-        // 开始时间
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#launch_start_time'
-            ,trigger: 'click'
-            ,done: function (value, date, endDate) {
-                var startDate = new Date(value).getTime();
-                var endTime = new Date($('#launch_end_time').val()).getTime();
-                if (endTime < startDate) {
-                    layer.msg('结束时间不能小于开始时间');
-                    $('#launch_start_time').val($('#launch_end_time').val());
-                }
-            }
-        });
-        laydate.render({
-            type: 'datetime'
-            ,elem: '#launch_end_time'
-            ,trigger: 'click'
-            ,done: function (value, date, endDate) {
-                var startDate = new Date($('#launch_start_time').val()).getTime();
-                var endTime = new Date(value).getTime();
-                if (endTime < startDate) {
-                    layer.msg('结束时间不能小于开始时间');
-                    $('#launch_end_time').val($('#launch_start_time').val());
-                }
-            }
-        });
-
-        //监听搜索
-        form.on('submit(search)', function(data){
-            var field = data.field;
-            table.reload('table-lists', {
-                where: field,
-                page: { curr: 1 }
-            });
-        });
-
-        // 监听重置搜素
-        form.on('submit(clear-search)', function(){
-            $('#bargain_sn').val('');
-            $('#goods_name').val('');
-            $('#status').val('');
-            $('#keyword_type').val('');
-            $('#keyword').val('');
-            $('#launch_start_time').val('');
-            $('#launch_end_time').val('');
-            form.render('select');
-            table.reload('table-lists', { where: [] });
-        });
-
-        $(document).on('click', '.day', function () {
-            var value = parseInt($(this).attr('day'));
-            var toDay = Times.getDay(value, false);
-            var curDay = Times.getDay(0);
-
-            $("#launch_start_time").val(toDay + ' 00:00:00');
-            $("#launch_end_time").val(curDay + ' 00:00:00');
-        })
-
-    });
-</script>

+ 0 - 110
app/admin/view/bargain/set.html

@@ -1,110 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    input::-webkit-outer-spin-button,
-    input::-webkit-inner-spin-button
-    {
-        -webkit-appearance: none;
-    }
-    input[type="number"]
-    {
-        -moz - appearance
-        :
-        textfield;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*砍价活动的通用设置。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 设置 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item" style="margin-bottom: 0;">
-                <label class="layui-form-label" style="width:200px;">砍价成功下单有效时长:</label>
-                <div class="layui-input-inline">
-                    <input type="number" name="payment_limit_time" value="{$payment_limit_time}" onkeyup="value=value.replace(/[^\d]/g,'')" autocomplete="off" class="layui-input">
-                </div>
-                <div class="layui-form-mid layui-word-aux">分钟</div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <div class="layui-input-block">
-                    <div class="layui-form-mid layui-word-aux">砍价成功后,在设置的有效时长内可以提交订单,为空或不填表示无时间限制</div>
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <div class="layui-input-block">
-                    <button class="layui-btn layui-btn-sm layuiadmin-btn {$view_theme_color}" lay-submit lay-filter="addSubmit">确定</button>
-                </div>
-            </div>
-
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        base: '/static/plug/layui-admin/dist/layuiadmin/'
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index', 'like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,like = layui.like;
-
-        form.on('submit(addSubmit)', function(data){
-            like.ajax({
-                url:'{:url("bargain.Bargain/set")}',
-                data: data.field,
-                type:"post",
-                success:function(res) {
-                    if(res.code === 1) {
-                        layui.layer.msg(res.msg, { offset:'15px', icon:1, time:1000 });
-                    } else {
-                        layui.layer.msg(res.msg, { offset:'15px', icon:2, time:1000 });
-                    }
-                }
-            });
-            return false;
-        });
-
-        //事件
-        var active = {
-            // 切换状态
-            set: function (obj) {
-
-                like.ajax({
-                    url:'{:url("TeamSet/set")}',
-                    data:{},
-                    type:"post",
-                    success:function(res) {
-                        if(res.code === 1) {
-                            layui.layer.msg(res.msg, { offset:'15px', icon:1, time:1000 });
-                        } else {
-                            layui.layer.msg(res.msg, { offset:'15px', icon:2, time:1000 });
-                        }
-                    }
-                });
-            }
-
-        };
-
-        // 绑定点击按钮事件
-        $('.layui-btn.layuiadmin-btn').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-    });
-</script>

+ 0 - 60
app/admin/view/bargain/violation.html

@@ -1,60 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block {
-        line-height: 38px;
-    }
-</style>
-<div class="layui-form" style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
-  <input type="hidden" name="id" value="{$id}" />
-
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">违规原因:</label>
-    <div class="layui-input-block">
-      <textarea name="description" placeholder="请输入内容" class="layui-textarea" style="width:380px;height:120px;"></textarea>
-    </div>
-  </div>
-
-  <div class="layui-form-item layui-hide">
-    <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-  </div>
-</div>
-
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like;
-      // 确认
-      form.on('submit(confirm)', function(data){
-        console.log(data.field)
-          // 审核
-          like.ajax({
-              url:'{:url("activity_area.goods/violation")}',
-              data:{'id':data.field.id,'review_status':data.field.review_status,'description': data.field.description},
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-      });
-      // 返回
-      form.on('submit(cancel)', function(data){
-        var index = parent.layer.getFrameIndex(window.name); 
-        parent.layer.close(index);
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-    });
-</script>

+ 0 - 7
public/.htaccess

@@ -1,7 +0,0 @@
-<IfModule mod_rewrite.c>
-   Options +FollowSymlinks
-   RewriteEngine On
-   RewriteCond %{REQUEST_FILENAME} !-d
-   RewriteCond %{REQUEST_FILENAME} !-f
-   RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L]
-</IfModule>