linwu пре 3 година
родитељ
комит
587e67a450

+ 414 - 0
app/Admin/Controllers/Content/BuyHouseNewsController.php

@@ -0,0 +1,414 @@
+<?php
+
+namespace App\Admin\Controllers\Content;
+
+use App\Admin\Extensions\Form\ValidateForm;
+use App\Http\Controllers\Controller;
+use App\Models\Article;
+use App\Models\ArticleCategory;
+use App\Models\ArticleProperty;
+use App\Models\Subsite;
+use App\Models\SubsiteArticle;
+use Encore\Admin\Controllers\HasResourceActions;
+use Encore\Admin\Facades\Admin as userAdmin;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Layout\Content;
+use Encore\Admin\Show;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Cache;
+
+class BuyHouseNewsController extends Controller
+{
+    use HasResourceActions;
+
+    /**
+     * Index interface.
+     *
+     * @param Content $content
+     * @return Content
+     */
+    public function index(Content $content)
+    {
+        return $content
+            ->header('公告列表')
+            ->description(' ')
+            ->body(view('admin.content.buy_house_news')->with(['grid'=>$this->grid()]));
+    }
+
+    /**
+     * Show interface.
+     *
+     * @param mixed $id
+     * @param Content $content
+     * @return Content
+     */
+    public function show($id, Content $content)
+    {
+
+        return $content
+            ->header('公告')
+            ->description(' ')
+            ->body($this->detail($id));
+    }
+
+    /**
+     * Edit interface.
+     *
+     * @param mixed $id
+     * @param Content $content
+     * @return Content
+     */
+    public function edit($id, Content $content)
+    {
+        return $content
+            ->header('公告')
+            ->description(' ')
+            ->body($this->editForm($id)->edit($id));
+    }
+
+    /**
+     * Create interface.
+     *
+     * @param Content $content
+     * @return Content
+     */
+    public function create(Content $content)
+    {
+        return $content
+            ->header('公告')
+            ->description(' ')
+            ->body($this->form());
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Article);
+
+        $grid->model()->where('type_id',56)->orderBy('list_order', 'DESC')->orderBy('created_at', 'DESC');
+
+        $grid->id('ID');
+        $grid->column('公告标题')->display(function () {
+            $style="color:".$this->tit_color.';';
+            if ($this->tit_b=='1') {
+                $style .='font-weight:bold;';
+            }
+            return '<span style="'.$style.'">'.$this->title.'</span>';
+        })->width(200);
+        $grid->small_img('缩略图')->display(function () {
+            if ($this->small_img) {
+                return '<span class="vtip" title="<img src=\''.upload_asset($this->small_img).'\'  height=120>">
+                            <img class="avatar small" src="'.upload_asset($this->small_img).'" align="absmiddle" style="width: 22px;height: 22px;">
+                        </span>';
+            } else {
+                return '';
+            }
+        });
+
+        $grid->robot('添加方式');
+        $grid->show_property()->category_name('公告属性');
+
+        $grid->list_order('排序');
+        $grid->click('点击量');
+        $grid->created_at('添加时间');
+        //新增按钮
+        $grid->disableCreateButton(false);
+        //批量删除
+        $grid->tools(function ($tools) {
+            $tools->batch(function ($batch) {
+                $batch->disableDelete(false);
+            });
+        });
+
+        $grid->actions(function ($actions) {
+            $actions->disableEdit(false);
+            $actions->disableDelete(false);
+        });
+
+        $grid->filter(function ($filter) {
+            $filter->disableIdFilter();
+            $filter->equal('ID', '公告ID');
+            $filter->like('title', '公告标题');
+
+            $date3   = date('Y-m-d', strtotime("-3 day"));
+            $date7   = date('Y-m-d', strtotime("-7 day"));
+            $date30  = date("Y-m-d", strtotime("-1 month"));
+            $date180 = date("Y-m-d", strtotime("-6 month"));
+            $date360 = date("Y-m-d", strtotime("-1 year"));
+            $date_option = array(
+                ''    => '不限',
+                $date3   => '三天内',
+                $date7   => '一周内',
+                $date30  => '一月内',
+                $date180 => '半年内',
+                $date360 => '一年内',
+            );
+            $filter->where(function ($query) {
+                $query->where('created_at', '>=', "{$this->input}");
+            }, '添加时间', 'created_at')->radio($date_option);
+        });
+        return $grid;
+    }
+    public function getCategory(Request $request)
+    {
+        $parent_id = $request->input('q');
+        $where = array('parent_id'=>$parent_id);
+        $not_ids = ArticleCategory::categoryIds();
+        if ($not_ids) {
+            $cates = ArticleCategory::where($where)->WhereNotIn('id', $not_ids)->get(['id', 'category_name'])->toArray();
+        } else {
+            $cates = ArticleCategory::where($where)->get(['id', 'category_name'])->toArray();
+        }
+
+        $pre_arr = array('id'=>'','category_name'=>'不限');
+        array_unshift($cates, $pre_arr);
+        return collect($cates);
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Article::findOrFail($id));
+
+        $show->id('ID');
+        $show->title('标题');
+        $show->tit_color('标题颜色')->as(function ($tit_color) {
+            $html = '<i style="background-color: '.$tit_color.';padding: 5px 15px;"></i>';
+            return $html;
+        })->setEscape(false);
+        $show->small_img('缩略图')->image();
+
+        $show->content('内容')->setEscape(false);
+        $show->is_display('是否显示')->as(function ($is_display) {
+            return $is_display?'是':'否';
+        });
+        $show->tit_b('标题加粗')->as(function ($tit_b) {
+            return $tit_b?'是':'否';
+        });
+        $show->released_at('发布日期');
+        $show->list_order('公告排序');
+        $show->author('作者')->as(function ($author) {
+            return $author?$author:'&nbsp';
+        })->setEscape(false);
+        $show->source('来源')->as(function ($source) {
+            return $source?$source:'&nbsp';
+        })->setEscape(false);
+        $show->is_url('外部链接')->as(function ($is_url) {
+            return $is_url?$is_url:'&nbsp';
+        })->setEscape(false);
+        $show->seo_keywords('Keywords')->as(function ($seo_keywords) {
+            return $seo_keywords?$seo_keywords:'&nbsp';
+        })->setEscape(false);
+        $show->seo_description('Description')->as(function ($seo_description) {
+            return $seo_description?$seo_description:'&nbsp';
+        })->setEscape(false);
+        $show->click('点击量');
+        $show->created_at('添加时间');
+        $show->updated_at('更新时间');
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new ValidateForm(new Article);
+        $form->text('title', '公告标题')->rules('required|max:100', array('required'=>'公告标题不能为空。','max'=>'公告标题长度不能大于100。'))->setWidth(4)->setMustMark();
+        $form->color('tit_color', '标题颜色')->rules('required|regex:/^#[a-fA-F0-9]{6}$/', array('required'=>'标题颜色不能为空。','regex'=>'标题颜色格式不正确。'))->default('#000000');
+        $form->image('small_img', '缩略图')->uniqueName()->rules('image|mimes:jpeg,bmp,png', array('image'=>'缩略图请选择图片文件。','mimes'=>'请选择jpeg,bmp,png格式的缩略图上传。'))->setWidth(3);
+        $form->ignore(['relate_subsites']);
+        $form->hidden('type_id')->value(56);
+        $form->hidden('parent_id')->value(0);
+        $form->hidden('property_id')->value(1);
+        $form->editor('content', '内容')->rules('required', array('required'=>'内容不能为空。'))->setMustMark();
+
+        $display_option = [
+            'on'  => ['value' => 1, 'text' => '是', 'color' => 'success'],
+            'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],
+        ];
+        $form->switch('is_display', '是否显示')->states($display_option)->default('1')->setMustMark();
+        $form->switch('tit_b', '标题加粗')->states($display_option)->default(0)->setMustMark();
+        $form->date('released_at', '发布日期')->format('YYYY-MM-DD')->rules('required|date', array('required'=>'发布日期不能为空。', 'date'=>'发布日期格式不正确。'))->default(date('Y-m-d', time()));
+        $form->number('list_order', '公告排序')->min(0)->default(255)->rules('required', array('required'=>'公告排序不能为空。'))->help('(数字越大越靠前)');
+        $form->text('author', '作者')->rules('max:20', array('max'=>'作者长度不能大于20。'))->setWidth(4);
+        $form->text('source', '来源')->rules('max:20', array('max'=>'来源长度不能大于20。'))->setWidth(4);
+        $form->url('is_url', '外部链接')->rules('max:250', array('max'=>'外部链接长度不能超过250。'))->help('(请输入包含http://或https://的完整链接)');
+        $form->text('seo_keywords', 'Keywords')->placeholder('合理设置Keywords有利于搜索引擎排名')->rules('max:80', array('max:Keywords不能大于80个字符。'));
+        $form->textarea('seo_description', 'Description')->placeholder('合理设置Description有利于搜索引擎排名')->rules('max:80', array('max'=>'Description不能大于80个字符。'));
+
+        $form->saving(function (Form $form) {
+            $form->released_at = strtotime($form->released_at);
+            $author = $form->author?$form->author:'';
+            $source = $form->source?$form->source:'';
+            $is_url = $form->is_url?$form->is_url:'';
+            $seo_keywords = $form->seo_keywords?$form->seo_keywords:'';
+            $seo_description = $form->seo_description?$form->seo_description:'';
+            $form->author = $author;
+            $form->source = $source;
+            $form->is_url = $is_url;
+            $form->seo_keywords = $seo_keywords;
+            $form->seo_description = $seo_description;
+        });
+        $form->saved(function (Form $form) {
+            $subsites = \Illuminate\Support\Facades\Request::input('relate_subsites');
+            if (empty($subsites)) {
+                $subsites = [];
+            }
+            $subsites = array_merge(array(get_subsite_id()), $subsites);
+            $set_data = array();
+            foreach ($subsites as $k => $v) {
+                if ($v !== null) {
+                    $set_data[] = array(
+                        'article_id' => $form->model()->id,
+                        'subsite_id'=> $v
+                    );
+                }
+                Cache::forget('article_index_list_home_'.$v);    //清除缓存
+            }
+            SubsiteArticle::insert($set_data);
+        });
+        $form->footer(function ($footer) {
+            $footer->disableViewCheck();
+            $footer->disableEditingCheck();
+            $footer->disableCreatingCheck();
+            $footer->disableReset();
+        });
+        return $form;
+    }
+    protected function editForm($id)
+    {
+        $info = Article::find($id);
+
+        $form = new ValidateForm(new Article);
+        $form->text('title', '公告标题')->rules('required|max:100', array('required'=>'公告标题不能为空。','max'=>'公告标题长度不能大于100。'))->setWidth(4)->setMustMark();
+        $form->color('tit_color', '标题颜色')->default('#000000')->rules('required|regex:/^#[a-fA-F0-9]{6}$/', array('required'=>'标题颜色不能为空。','regex'=>'标题颜色格式不正确。'));
+        $form->image('small_img', '缩略图')->uniqueName()->rules('image|mimes:jpeg,bmp,png', array('image'=>'缩略图请选择图片文件。','mimes'=>'请选择jpeg,bmp,png格式的缩略图上传。'))->setWidth(3);
+        $form->ignore(['relate_subsites']);
+        $form->hidden('subsite_id')->value(get_subsite_id());
+        $form->hidden('parent_id');
+
+        $form->editor('content', '内容')->rules('required', array('required'=>'内容不能为空。'))->setMustMark();
+        $display_option = [
+            'on'  => ['value' => 1, 'text' => '是', 'color' => 'success'],
+            'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],
+        ];
+        $form->switch('is_display', '是否显示')->states($display_option)->setMustMark();
+        $form->switch('tit_b', '标题加粗')->states($display_option)->setMustMark();
+        $form->date('released_at', '发布日期')->format('YYYY-MM-DD')->rules('required|date', array('required'=>'发布日期不能为空。', 'date'=>'发布日期格式不正确。'));
+        $form->number('list_order', '公告排序')->min(0)->default(0)->rules('required', array('required'=>'公告排序不能为空。'))->help('(数字越大越靠前)');
+        $form->text('author', '作者')->rules('max:20', array('max'=>'作者长度不能大于20。'))->setWidth(3);
+        $form->text('source', '来源')->rules('max:20', array('max'=>'来源长度不能大于20。'))->setWidth(3);
+        $form->url('is_url', '外部链接')->rules('max:250', array('max'=>'外部链接长度不能超过250。'))->help('(请输入包含http://或https://的完整链接)');
+        $form->text('seo_keywords', 'Keywords')->placeholder('合理设置Keywords有利于搜索引擎排名')->rules('max:80', array('max:Keywords不能大于80个字符。'));
+        $form->textarea('seo_description', 'Description')->placeholder('合理设置Description有利于搜索引擎排名')->rules('max:80', array('max'=>'Description不能大于80个字符。'));
+        $form->saving(function (Form $form) {
+            if (!request()->has(Form\Field::FILE_DELETE_FLAG)) {
+                $form->released_at = strtotime($form->released_at);
+                $author = $form->author?$form->author:'';
+                $source = $form->source?$form->source:'';
+                $is_url = $form->is_url?$form->is_url:'';
+                $seo_keywords = $form->seo_keywords?$form->seo_keywords:'';
+                $seo_description = $form->seo_description?$form->seo_description:'';
+                $form->author = $author;
+                $form->source = $source;
+                $form->is_url = $is_url;
+                $form->seo_keywords = $seo_keywords;
+                $form->seo_description = $seo_description;
+            }
+        });
+
+        $form->saved(function (Form $form) {
+            if (!request()->has(Form\Field::FILE_DELETE_FLAG)) {
+                $subsites = \Illuminate\Support\Facades\Request::input('relate_subsites');
+                if (empty($subsites)) {
+                    $subsites = [];
+                }
+                $subsites = array_merge(array($form->model()->subsite_id), $subsites);
+                SubsiteArticle::where('article_id', $form->model()->id)->delete();
+                $set_data = array();
+                foreach ($subsites as $k => $v) {
+                    if ($v !== null) {
+                        $set_data[] = array(
+                            'article_id' => $form->model()->id,
+                            'subsite_id'=> $v
+                        );
+                    }
+                    Cache::forget('article_index_list_home_'.$v);    //清除缓存
+                }
+                SubsiteArticle::insert($set_data);
+            }
+        });
+        $form->footer(function ($footer) {
+            $footer->disableViewCheck();
+            $footer->disableEditingCheck();
+            $footer->disableCreatingCheck();
+            $footer->disableReset();
+        });
+        $form->tools(function (Form\Tools $tools) {
+            $tools->disableDelete();
+            $tools->disableView();
+        });
+        return $form;
+    }
+    public function update($id)
+    {
+        return $this->editForm($id)->update($id);
+    }
+    public function destroy($id)
+    {
+        $ids = array();
+        if ($id) {
+            $ids = explode(',', $id);
+        }
+        if (get_subsite_id() == 0) {
+            $filter_id = $id;
+        } else {
+            $seletctors = Article::where(array('subsite_id'=>get_subsite_id()))->whereIn('id', $ids)->get()->pluck('id')->toarray();
+            if ($seletctors) {
+                $filter_id = implode(',', $seletctors);
+            } else {
+                $filter_id = '';
+            }
+        }
+        //获取所有分站信息
+        $subsites = Subsite::where(array('effective'=>1))->orderBy('order', 'asc')->get()->pluck('sitename', 'id')->toArray();
+        if ($subsites) {
+            foreach ($subsites as $key => $val) {
+                Cache::forget('article_index_list_home_'.$key);
+            }
+        }
+        if ($filter_id) {
+            if ($this->form()->destroy($filter_id)) {
+                $data = [
+                    'status'  => true,
+                    'message' => trans('admin.delete_succeeded'),
+                ];
+            } else {
+                $data = [
+                    'status'  => false,
+                    'message' => trans('admin.delete_failed'),
+                ];
+            }
+        } else {
+            $data = [
+                'status'  => false,
+                'message' => '不能删除其它分站数据!',
+            ];
+        }
+        return response()->json($data);
+    }
+}

+ 0 - 8
app/Admin/Controllers/Content/BuyHouseRsController.php

@@ -2,21 +2,13 @@
 
 namespace App\Admin\Controllers\Content;
 
-use App\Admin\Exports\Content\RecuperateExport;
-use App\Admin\Extensions\Form\ValidateForm;
 use App\Http\Controllers\Controller;
-use App\Models\Recuperate;
-use App\Models\RecuperateApply;
-use App\Models\RecuperateCategory;
 use App\Models\TalentHouse;
 use App\Models\TalentHouseApply;
 use Encore\Admin\Controllers\HasResourceActions;
-use Encore\Admin\Facades\Admin as userAdmin;
-use Encore\Admin\Form;
 use Encore\Admin\Grid;
 use Encore\Admin\Layout\Content;
 use Illuminate\Http\Request;
-use Illuminate\Support\Collection;
 
 class BuyHouseRsController extends Controller
 {

+ 202 - 0
app/Admin/Controllers/Content/BuyHouseZjController.php

@@ -0,0 +1,202 @@
+<?php
+
+namespace App\Admin\Controllers\Content;
+
+use App\Http\Controllers\Controller;
+use App\Models\TalentHouse;
+use App\Models\TalentHouseApply;
+use Encore\Admin\Controllers\HasResourceActions;
+use Encore\Admin\Grid;
+use Encore\Admin\Layout\Content;
+use Illuminate\Http\Request;
+
+class BuyHouseZjController extends Controller
+{
+    use HasResourceActions;
+
+    private $status = ['未知', '待审核', '审核通过', '审核不通过'];
+    private $marry = ['未知', '未婚', '已婚', '离异', '丧偶'];
+
+    /**
+     * Index interface.
+     *
+     * @param Content $content
+     * @return Content
+     */
+    public function index(Content $content)
+    {
+        return $content
+            ->header('申报列表')
+            ->description(' ')
+            ->body(view('admin.content.buy_house_zj')->with(['grid' => $this->grid()]));
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new TalentHouseApply());
+
+        $grid->model()->with('house')->where('rs_check_status',2)->orderBy('zj_check_status', 'ASC');
+
+        $status_text = $this->status;
+        $grid->id('ID');
+        $grid->name('姓名');
+        $grid->mobile('联系电话');
+        $grid->talent_level('人才层次');
+        $grid->column('房源')->display(function () {
+            return $this->house->name;
+        });
+        $grid->zj_check_status('状态')->display(function () use ($status_text) {
+            return $status_text[$this->zj_check_status];
+        });
+        $grid->zj_check_comment('备注');
+
+        $grid->actions(function ($actions) {
+            if ($actions->row['zj_check_status'] == 1) {
+                $actions->append("<button class='btn btn-primary btn-xs applyaudit' data-code=" . $actions->row['id'] . ">审核</button>");
+            }
+            $actions->append("&nbsp;<button class='btn btn-primary btn-xs detail' id=" . $actions->row['id'] . ">详情</button>");
+        });
+
+        $grid->filter(function ($filter) {
+            $filter->disableIdFilter();
+            $filter->equal('house_id', '房源')->select(TalentHouse::all()->pluck('name', 'id'));
+            $status_option = ['全部', '待审核', '审核通过', '审核不通过'];
+            $filter->where(function ($query) {
+                if ($this->input > 0) {
+                    $query->where('status', '=', $this->input);
+                }
+            }, '状态', 'status')->radio($status_option);
+        });
+        return $grid;
+    }
+
+    /**
+     * 审核
+     */
+    public function audit(Request $request)
+    {
+        $id     = $request->id;
+        $status = $request->status;
+        $reason = $request->reason;
+        $url    = empty($request->url) ? admin_base_path('content/buy_house_zj') : $request->url;
+        if (empty($id)) {
+            admin_toastr('数据异常', 'error');
+            return redirect(admin_base_path('content/buy_house_zj'));
+        }
+        $result = TalentHouseApply::where('id', '=', $id)
+            ->update([
+                'zj_check_status'  => $status,
+                'zj_check_comment' => $reason,
+                'zj_check_time'    => date('Y-m-d H:i:s'),
+            ]);
+        if ($result) {
+            admin_toastr('审核成功', 'success');
+        } else {
+            admin_toastr('该信息不存在或已审核', 'error');
+        }
+
+        return redirect($url);
+    }
+
+    /**
+     * 详情
+     */
+    public function detail(Request $request)
+    {
+        $id   = $request->id;
+        $info = TalentHouseApply::find($id);;
+        $info->family = json_decode($info->family);
+        $info->marry_text = $this->marry[$info->marry];
+
+        //layer相册层
+        $photos = [
+            'certificates'       => [],
+            'marry_prove'        => [],
+            'household_register' => [],
+            'work_prove'         => [],
+        ];
+        if (!empty(json_decode($info->certificates))) {
+            $info->certificates = json_decode($info->certificates);
+            $photo_data         = [];
+            foreach ($info->certificates as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['certificates'] = [
+                'title' => '证件信息',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->certificates = [];
+        }
+        if (!empty(json_decode($info->marry_prove))) {
+            $info->marry_prove = json_decode($info->marry_prove);
+            $photo_data        = [];
+            foreach ($info->marry_prove as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['marry_prove'] = [
+                'title' => '婚姻证明',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->marry_prove = [];
+        }
+        if (!empty(json_decode($info->household_register))) {
+            $info->household_register = json_decode($info->household_register);
+            $photo_data               = [];
+            foreach ($info->household_register as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['household_register'] = [
+                'title' => '户口本',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->household_register = [];
+        }
+        if (!empty(json_decode($info->work_prove))) {
+            $info->work_prove = json_decode($info->work_prove);
+            $photo_data       = [];
+            foreach ($info->work_prove as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['work_prove'] = [
+                'title' => '在职证明',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->work_prove = [];
+        }
+        $html = view('admin.ajax.buy_house_detail')->with(['info' => $info, 'photos' => $photos])->render();
+        return response()->json(['code' => 1, 'data' => $html]);
+    }
+}

+ 4 - 0
app/Admin/routes.php

@@ -325,6 +325,10 @@ Route::group([
         $router->get('buy_house_rs', 'BuyHouseRsController@index')->name('content.buy_house_rs');
         $router->get('buy_house_rs/detail', 'BuyHouseRsController@detail')->name('content.buy_house_rs.detail');
         $router->post('buy_house_rs/audit', 'BuyHouseRsController@audit')->name('content.buy_house_rs.audit');
+        $router->get('buy_house_zj', 'BuyHouseZjController@index')->name('content.buy_house_zj');
+        $router->get('buy_house_zj/detail', 'BuyHouseZjController@detail')->name('content.buy_house_zj.detail');
+        $router->post('buy_house_zj/audit', 'BuyHouseZjController@audit')->name('content.buy_house_zj.audit');
+        $router->resource('buy_house_news', BuyHouseNewsController::class)->names('content.buy_house_news');
     });
 
     //系统管理

+ 1 - 1
app/Http/Controllers/Web/Content/BuyhouseController.php

@@ -55,7 +55,7 @@ class BuyhouseController extends WebBaseController
         $return_data['house'] = $house;
 
         //新闻
-        $news = Article::where('type_id', 56)->select(['id', 'title', 'updated_at'])->orderBy('updated_at', 'desc')->limit(10)->get();
+        $news = Article::where('type_id', 56)->where('is_display',1)->select(['id', 'title', 'updated_at'])->orderBy('list_order', 'desc')->limit(10)->get();
         foreach ($news as $v) {
             $v['updated_at_text'] = date('Y-m-d', strtotime($v['updated_at']));
             $v['url']             = route('news.show', ['id' => $v['id']]);

+ 55 - 0
resources/views/admin/content/buy_house_news.blade.php

@@ -0,0 +1,55 @@
+{!! $grid->render() !!}
+<style>
+    p#vtip { display: none; position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 9999 }
+    p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
+</style>
+<script>
+    this.vtip = function() {
+        this.xOffset = -10; // x distance from mouse
+        this.yOffset = 15; // y distance from mouse
+        $(".vtip").unbind().hover(
+            function(e) {
+                this.t = $(this).attr("title");
+                this.title = '';
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $('body').css("cursor","help");
+                $('p#vtip').width()>450?$('p#vtip').width(450):'';
+                $('body').append( '<p id="vtip">' + this.t + '</p>' );
+                $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn(0);
+            },
+            function() {
+                this.title = this.t;
+                $('body').css("cursor","");
+                $("p#vtip").fadeOut("slow").remove();
+            }
+        ).mousemove(
+            function(e) {
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
+            }
+        );
+
+    };
+    $(document).ready(function() {
+        vtip();
+        $('select[name="parent_id"]').parent().parent().attr('id','parent_id_div');
+        $('select[name="type_id"]').parent().parent().attr('id','type_id_div');
+        $('#parent_id_div select[name="parent_id"]').change(function(){
+            if($(this).val() ==''){
+                $('#type_id_div').css('display','none');
+                $('select[name="type_id"]').val('');
+            }else{
+                $('#type_id_div').css('display','block');
+            }
+        });
+
+        var parent_id = $('#parent_id_div select[name="parent_id"]').val();
+        if(parent_id ==''){
+            $('#type_id_div').css('display','none');
+        }else{
+            $('#type_id_div').css('display','block');
+        }
+    });
+</script>

+ 131 - 0
resources/views/admin/content/buy_house_zj.blade.php

@@ -0,0 +1,131 @@
+{!! $grid->render() !!}
+<style>
+    p#vtip { display: none; position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 9999 }
+    p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
+</style>
+<div class="modal fade" id="audit" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title" id="myModalLabel12">申报审核</h4>
+            </div>
+            <div class="modal-body">
+                <div class="modal-body">
+                    <form method="POST" action="{{route('content.buy_house_zj.audit')}}" id="auditForm" class="form-horizontal" accept-charset="UTF-8" pjax-container="1" id="dialog-form-5cc19c85d0a5f">
+                        <div class="box-body fields-group">
+                            <div class="form-group  ">
+                                <label for="audit1" class="col-sm-2  control-label">审核状态</label>
+                                <div class="col-sm-8">
+                                    <label class="radio-inline">
+                                        <input type="radio" name="status" value="2" class="minimal audit1" checked>
+                                        &nbsp;审核通过&nbsp;&nbsp;
+                                    </label>
+                                    <label class="radio-inline">
+                                        <input type="radio" name="status" value="3" class="minimal audit1" >
+                                        &nbsp;审核不通过&nbsp;&nbsp;
+                                    </label>
+                                </div>
+                            </div>
+                            <div class="form-group  ">
+                                <label for="reason" class="col-sm-2  control-label">备注</label>
+                                <div class="col-sm-8">
+                                    <textarea name="reason" class="form-control reason" rows="5" placeholder="输入 备注"></textarea>
+                                </div>
+                            </div>
+                        </div>
+                        <input type="hidden" name="id" id="id" value="" />
+                        <input type="hidden" name="url" id="url" value="{{url()->full()}}" />
+                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
+                    </form>
+                </div>
+                <div class="modal-footer">
+                    {{--<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>取消</button>--}}
+                    <button type="button" id="dialog-submit-5cc19c85d0a5f" class="btn btn-primary" data-loading-text="提交中..."><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>确认</button>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="modal fade" id="dialog" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
+    <div class="modal-dialog" role="document" style="width:1200px;">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title" id="myModalLabel1">业务</h4>
+            </div>
+            <div class="modal-body">
+
+                <div class="contentfade" style="height: 700px;overflow: auto;">
+
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    this.vtip = function() {
+        this.xOffset = -10; // x distance from mouse
+        this.yOffset = 15; // y distance from mouse
+        $(".vtip").unbind().hover(
+            function(e) {
+                this.t = $(this).attr("title");
+                this.title = '';
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $('body').css("cursor","help");
+                $('p#vtip').width()>450?$('p#vtip').width(450):'';
+                $('body').append( '<p id="vtip">' + this.t + '</p>' );
+                $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn(0);
+            },
+            function() {
+                this.title = this.t;
+                $('body').css("cursor","");
+                $("p#vtip").fadeOut("slow").remove();
+            }
+        ).mousemove(
+            function(e) {
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
+            }
+        );
+
+    };
+    $(document).ready(function() {
+        vtip();
+    });
+    $(document).off("click",'.applyaudit').on('click','.applyaudit',function () {
+        $('#id').val($(this).data('code'));
+        $('#audit').addClass('in');
+        $('#audit').css('display', 'block');
+        $(' #audit .contentfade').html('');
+    });
+    $(document).off("click","#audit .btn-primary").on('click',"#audit .btn-primary",function () {
+        $('#auditForm').submit();
+    });
+    $(".close").off().on('click', function () {
+        $(this).closest(".modal").removeClass('in');
+        $(this).closest(".modal").hide();
+    });
+
+    $('.detail').on('click', function () {
+        $("#myModalLabel1").html('详情');
+        var id = $(this).attr('id');
+        $('#dialog').addClass('in');
+        $('#dialog').css('display', 'block');
+        $('.contentfade').html('');
+        $.ajax({
+            url: "{{admin_base_path('/content/buy_house_zj/detail')}}",
+            data:{'id':id,'_token':'{{csrf_token()}}'},
+            // dataType:'json',
+            success:function (res) {
+                console.log(res);
+                $('.contentfade').html(res.data);
+            },
+        })
+    });
+</script>