wupengfei 2 yıl önce
ebeveyn
işleme
72dc6542e6

+ 5 - 2
.idea/workspace.xml

@@ -2,8 +2,11 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/operate/controller/Recruit.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/recruit/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/recruit/index.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/recruit/index_search.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/recruit_cate/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/recruit_cate/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -207,7 +210,7 @@
       <workItem from="1663115672199" duration="17172000" />
       <workItem from="1663216924630" duration="8987000" />
       <workItem from="1663289320226" duration="8186000" />
-      <workItem from="1663374115380" duration="2877000" />
+      <workItem from="1663374115380" duration="3261000" />
     </task>
     <servers />
   </component>

+ 147 - 0
application/operate/controller/Recruit.php

@@ -0,0 +1,147 @@
+<?php
+namespace app\operate\controller;
+use library\Controller;
+use think\Db;
+/**
+ * 招聘
+ * Class Activity
+ * @package app\operate\controller
+ */
+class Recruit extends Controller
+{
+    protected $table = 'Recruit';
+
+    /**
+     * 列表
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function index()
+    {
+        $this->title = '列表';
+        $where = [];
+        $where[] = ['f.is_deleted','=',0];
+        if($title = input('title')) $where[] = ['f.title','like','%'.$title.'%'];
+        $query = $this->_query($this->table)->alias('f')
+            ->field('f.*')
+            ->where($where)
+            ->order('f.id desc,sort desc')->page();
+    }
+
+
+    /**
+     * 添加
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function add()
+    {
+        $this->title = '添加';
+        $this->_form($this->table, 'form');
+    }
+
+    /**
+     * 编辑
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function edit()
+    {
+        $this->title = '编辑';
+        $this->_form($this->table, 'form');
+    }
+
+    /**
+     * 删除
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => '1']);
+    }
+
+    /**
+     * 表单数据处理
+     * @param array $data
+     */
+    protected function _form_filter(&$data)
+    {
+        if ($this->request->isGet() && $this->request->action() == 'add') {
+            $this->isAddMode = 1;
+            $this->ladder = [];
+        }
+
+        if ($this->request->isGet() && $this->request->action() == 'edit') {
+            $this->isAddMode = 0;
+            $this->ladder = isset_full($data,'ladder') ? json_decode($data['ladder'],true):[];
+        }
+
+        if($this->request->isPost())
+        {
+            list($post,$ladder_data) = [$this->request->post(),[]];
+            foreach (array_keys($post['ladder_title']) as $key) {
+                 array_push($ladder_data, [
+                    'ladder_title'      => $post['ladder_title'][$key],
+                    'ladder_num'        => intval($post['ladder_num'][$key]),
+                    'ladder_price'      => sprintf('%.2f',$post['ladder_price'][$key]),
+                ]);
+            }
+            $data['ladder'] = json_encode($ladder_data);
+        }
+
+
+    }
+
+    /**
+     * 报名记录
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function apply()
+    {
+        $id = $this->request->get('act_id');
+        $name = $this->request->get('name');
+        $phone = $this->request->get('phone');
+        $this->title = '报名记录';
+        $where = [];
+        $where[]= ['a.act_id','=' ,$id];
+        $where[]= ['a.is_deleted','=' ,0];
+        $where[]= ['a.status','=' ,1];
+        $where[]= ['a.status','=' ,1];
+        if($name)  $where[]= ['a.name','like' ,'%'.$name.'%'];
+        if($phone)  $where[]= ['a.phone','like' ,'%'.$phone.'%'];
+        $query = $this->_query('activity_apply')
+            ->alias('a')
+            ->field('a.*,u.name user_name,u.headimg')
+            ->where($where)
+            ->leftJoin('store_member u','u.id = a.user_id')
+            ->order('a.id desc')->page();
+        $this->fetch();
+    }
+
+
+
+
+}

+ 267 - 0
application/operate/view/recruit/form.html

@@ -0,0 +1,267 @@
+{extend name='admin@main'}
+
+{block name="content"}
+
+{include file='mall@store_goods/form_style'}
+<style>
+    .layui-form-radio{
+        margin: 0 !important;
+        padding-right:0 !important;
+    }
+    .layui-form-select{
+        margin-right: 10px !important;
+    }
+    .layui-col-xs9{
+        width: 90%;
+    }
+</style>
+<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
+
+    <div class="layui-card-body think-box-shadow padding-left-40">
+        <div class="layui-tab">
+            <ul class="layui-tab-title">
+                <li class="layui-this">活动设置</li>
+            </ul>
+            <div class="layui-tab-content">
+                <!--基础设置-->
+                <div class="layui-tab-item layui-show">
+                    <!--基础设置start-->
+                    <div class="layui-form-item layui-row layui-col-space15">
+
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green">标题</span>
+                            <input name="title" required class="layui-input" placeholder="请输入活动标题" value="{$vo.title|default=''}">
+                        </label>
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green">标签</span>
+                            <input name="label" required class="layui-input" placeholder="请输入活动标签" value="{$vo.label|default=''}">
+                        </label>
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green">活动地址</span>
+                            <input name="address" required class="layui-input" placeholder="请输入活动活动地址" value="{$vo.address|default=''}">
+                        </label>
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">价格</span>
+                            <input name="price" required class="layui-input" placeholder="请输入活动价格" value="{$vo.price|default=''}">
+                        </label>
+
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">开始时间</span>
+                            <input name="start_time" id="start_time" required class="layui-input" placeholder="请输入开始时间" value="{$vo.start_time|default=''}">
+                        </label>
+
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">结束时间</span>
+                            <input name="end_time" id="end_time"  required class="layui-input" placeholder="请输入结束时间" value="{$vo.end_time|default=''}">
+                        </label>
+
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green label-required-prev">报名价格设置</span>
+                            <table class="layui-table">
+                                <thead>
+                                <tr>
+                                    <th class="text-left">标题</th>
+                                    <th class="text-left">人数</th>
+                                    <th class="text-left">价格[每人]</th>
+                                    <th class="text-left">操作</th>
+                                </tr>
+                                <tbody class="no_html">
+
+                                </tbody>
+                                </thead>
+                            </table>
+                        </label>
+                    </div>
+
+
+
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green label-required-prev">图片</span>
+                            <table class="layui-table">
+                                <thead>
+                                <tr>
+                                    <th class="text-left">展示图片</th>
+                                </tr>
+                                <tr>
+                                    <td width="auto" class="text-left"><input name="cover" type="hidden" value="{$vo.cover|default=''}"></td>
+                                </tr>
+                                </thead>
+                            </table>
+                        </label>
+                        <script>$('[name="cover"]').uploadMultipleImage()</script>
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs9 relative">
+                            <span class="color-green">详情</span>
+                            <textarea name="content">{$vo.content|default=""}</textarea>
+                        </label>
+                    </div>
+                    <div class="layui-form-item text-center">
+                        {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
+                        <button class="layui-btn layui-btn-danger" ng-click="hsitoryBack()" type="button">取消</button>
+                        <button class="layui-btn" type="submit">保存</button>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+    </div>
+</form>
+{/block}
+
+{block name='script'}
+<textarea class="layui-hide" id="goods-specs">{$vo.specs|raw|default=''}</textarea>
+<textarea class="layui-hide" id="goods-value">{$defaultValues|raw|default=''}</textarea>
+<script>
+    window.form.render();
+    layui.use('form', function () {
+        var form = layui.form;
+        //日期时间范围
+        laydate.render({
+            elem: '#start_time'
+            ,type: 'datetime'
+        });
+        laydate.render({
+            elem: '#end_time'
+            ,type: 'datetime'
+        });
+    })
+
+    layui.use('element', function(){
+        var $ = layui.jquery
+            ,element = layui.element;
+        var active = {
+            tabAdd: function(){
+                element.tabAdd('demo', {
+                    title: '新选项'+ (Math.random()*1000|0)
+                    ,content: '内容'+ (Math.random()*1000|0)
+                    ,id: new Date().getTime()
+                })
+            }
+            ,tabDelete: function(othis){
+                element.tabDelete('demo', '44');
+                othis.addClass('layui-btn-disabled');
+            }
+            ,tabChange: function(){
+                element.tabChange('demo', '22');
+            }
+        };
+
+        $('.site-demo-active').on('click', function(){
+            var othis = $(this), type = othis.data('type');
+            active[type] ? active[type].call(this, othis) : '';
+        });
+
+        //Hash地址的定位
+        var layid = location.hash.replace(/^#test=/, '');
+        element.tabChange('test', layid);
+
+        element.on('tab(test)', function(elem){
+            location.hash = 'test='+ $(this).attr('lay-id');
+        });
+
+    });
+    require(['ckeditor', 'angular'], function () {
+        window.createEditor('[name="content"]', {
+            height: 500,
+
+        });
+    })
+
+
+    // 添加设置
+    $(document).on('click',".add_goods_no",function () {
+        var knum = $('.no_html tr').length;
+        var no_html = get_ht(knum);
+        $(".no_html").append(no_html);
+        form.render();
+        console.log(a);// 别删这个!!!
+    })
+    // 删除设置
+    $(document).on('click',".del_no",function (){
+        var knum = $('.no_html tr').length;
+        if(knum == 1) {
+            layer.msg('不能全部删除!')
+            form.render();
+            console.log(a);// 别删这个!!!
+        }
+        var index= $(".del_no").index(this);
+        $(".no_detail").eq(index).remove();
+        form.render();
+        console.log(a);// 别删这个!!!
+    })
+    var is_add = parseInt('{$isAddMode|default=0}');
+    if(is_add){
+        $(".no_html").html(get_ht(0));
+    }else{
+        var ladder = {:json_encode($ladder)};
+        console.log(ladder);
+        if(ladder && ladder.length > 0) {
+            var no_html = '';
+            $.each(ladder,function (lk,lv) {
+                no_html  += ' <tr  class="no_detail change_del" data-dh ="'+lk+'">';
+                no_html  +=     "<td class='text-left nowrap'>" +
+                    "<input type='text'  class='layui-input' name='ladder_title[]' value='"+lv.ladder_title+"'/>" +
+                    "</td>";
+                no_html  +=     "<td class='text-left nowrap'>" +
+                    "<input type=''  class='layui-input' name='ladder_num[]' value='"+lv.ladder_num+"'/>" +
+                    "</td>";
+                no_html  +=     "<td class='text-left nowrap'>" +
+                    "<input type=''  class='layui-input' name='ladder_price[]' value='"+lv.ladder_price+"'/>" +
+                    "</td>";
+                no_html  +=     "<td class='text-left nowrap'>" +
+                    "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
+                    "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
+                    "</td>"
+                no_html  += "</tr>";
+            })
+            $(".no_html").html(no_html);
+        }else{
+            $(".no_html").html(get_ht(0));
+        }
+        window.form.render();
+    }
+    function  get_ht(k) {
+        var award_length = $(".no_detail").length;
+        var no_html = '';
+        no_html  += ' <tr  class="no_detail change_del" data-dh ="'+k+'">';
+        no_html  +=     "<td class='text-left nowrap'>" +
+            "<input type='text'  class='layui-input' name='ladder_title[]' value=''/>" +
+            "</td>";
+        no_html  +=     "<td class='text-left nowrap'>" +
+            "<input type=''  class='layui-input' name='ladder_num[]' value=''/>" +
+            "</td>";
+        no_html  +=     "<td class='text-left nowrap'>" +
+            "<input type=''  class='layui-input' name='ladder_price[]' value=''/>" +
+            "</td>";
+        no_html  +=     "<td class='text-left nowrap'>" +
+            "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
+            "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
+            "</td>"
+        no_html  += "</tr>";
+        return   no_html;
+    }
+
+</script>
+{/block}

+ 61 - 0
application/operate/view/recruit/index.html

@@ -0,0 +1,61 @@
+{extend name='admin@main'}
+
+{block name="button"}
+<button data-open='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
+{/block}
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='recruit/index_search'}
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='text-left nowrap'>标题</th>
+            <th class='text-left nowrap'>封面</th>
+            <th class='text-left '>添加时间</th>
+            <th class="text-left" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='text-left nowrap'>{$vo.title|default='--'}</td>
+            <td class='text-left nowrap'><img data-tips-image="{$vo.cover|default=''}"  src="{$vo.cover|default=''}" height="50" width="110px"></td>
+            <td class='text-left'>{$vo.create_at|default='--'}</td>
+            <td class='text-left' style="width: 20%">
+                <a data-title="编辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
+
+                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/operate/activity/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}
+
+
+

+ 16 - 0
application/operate/view/recruit/index_search.html

@@ -0,0 +1,16 @@
+<fieldset>
+    <legend>条件搜索</legend>
+    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+        <div class="layui-form-item layui-inline">
+            <label class="layui-form-label">标题</label>
+            <div class="layui-input-inline">
+                <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入标题" class="layui-input">
+            </div>
+        </div>
+
+        <div class="layui-form-item layui-inline">
+            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+        </div>
+    </form>
+    <script>form.render()</script>
+</fieldset>