|
@@ -18,7 +18,7 @@ class BuyHouseZrController extends Controller
|
|
|
{
|
|
|
use HasResourceActions;
|
|
|
|
|
|
- private $status = ['未知', '待审核', '审核通过', '审核驳回'];
|
|
|
+ private $status = ['未知', '待审核', '审核通过', '审核驳回', '审核不通过'];
|
|
|
private $marry = ['未知', '未婚', '已婚', '离异', '丧偶'];
|
|
|
|
|
|
/**
|
|
@@ -44,7 +44,7 @@ class BuyHouseZrController extends Controller
|
|
|
{
|
|
|
$grid = new Grid(new TalentHouseApply());
|
|
|
|
|
|
- $grid->model()->with(['house','idcard'])->where('is_back',2)->where('zj_check_status',2)->orderBy('zr_check_status', 'ASC');
|
|
|
+ $grid->model()->with(['house', 'idcard'])->where('is_back', 2)->where('rs_check_status', 2)->orderBy('zr_check_status', 'ASC');
|
|
|
|
|
|
$status_text = $this->status;
|
|
|
$grid->id('ID');
|
|
@@ -57,19 +57,17 @@ class BuyHouseZrController extends Controller
|
|
|
$grid->zr_check_status('状态')->display(function () use ($status_text) {
|
|
|
return $status_text[$this->zr_check_status];
|
|
|
});
|
|
|
- $grid->zr_check_status('备注')->style('max-width:400px');
|
|
|
+ $grid->zr_check_comment('备注')->style('max-width:400px');
|
|
|
|
|
|
$grid->actions(function ($actions) {
|
|
|
- if ($actions->row['zr_check_status'] == 1) {
|
|
|
- $actions->append("<button class='btn btn-primary btn-xs applyaudit' data-code=" . $actions->row['id'] . ">审核</button>");
|
|
|
- }
|
|
|
- $actions->append(" <button class='btn btn-primary btn-xs detail' id=" . $actions->row['id'] . ">详情</button>");
|
|
|
+ $actions->append(" <button class='btn btn-primary btn-xs detail' id=" . $actions->row['id'] . ">详情审核</button>");
|
|
|
});
|
|
|
|
|
|
$grid->filter(function ($filter) {
|
|
|
$filter->disableIdFilter();
|
|
|
+ $filter->like('name', '姓名');
|
|
|
$filter->equal('house_id', '房源')->select(TalentHouse::all()->pluck('name', 'id'));
|
|
|
- $status_option = ['全部', '待审核', '审核通过', '审核驳回'];
|
|
|
+ $status_option = ['全部', '待审核', '审核通过', '审核驳回', '审核不通过'];
|
|
|
$filter->where(function ($query) {
|
|
|
if ($this->input > 0) {
|
|
|
$query->where('zr_check_status', '=', $this->input);
|
|
@@ -96,16 +94,22 @@ class BuyHouseZrController extends Controller
|
|
|
admin_toastr('数据异常', 'error');
|
|
|
return redirect(admin_base_path('content/buy_house_zj'));
|
|
|
}
|
|
|
- $result = TalentHouseApply::where('id', '=', $id)
|
|
|
- ->update([
|
|
|
- 'zr_check_status' => $status,
|
|
|
- 'zr_check_comment' => $reason,
|
|
|
- 'zr_check_time' => date('Y-m-d H:i:s'),
|
|
|
- 'status' => $status,
|
|
|
- ]);
|
|
|
+ $apply = TalentHouseApply::find($id);
|
|
|
+ $apply->zr_check_status = $status;
|
|
|
+ $apply->zr_check_comment = $reason;
|
|
|
+ $apply->zr_check_time = date('Y-m-d H:i:s');
|
|
|
+ if ($apply->status == 4) {
|
|
|
+ $apply->is_sock = 2;
|
|
|
+ } else {
|
|
|
+ if ($apply->zj_check_status == 2) {
|
|
|
+ $apply->status = $status;
|
|
|
+ } else {
|
|
|
+ $apply->status = $status == 2 ? 1 : $status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $result = $apply->save();
|
|
|
|
|
|
//日志
|
|
|
- $apply = TalentHouseApply::find($id);
|
|
|
$house = TalentHouse::find($apply['house_id']);
|
|
|
$admin = Admin::user();
|
|
|
$log = [
|
|
@@ -121,7 +125,7 @@ class BuyHouseZrController extends Controller
|
|
|
|
|
|
//审核不通过发送短信
|
|
|
if ($status == 3) {
|
|
|
- $time = strtotime($house['supply_time']);
|
|
|
+ $time = strtotime($house['supply_time']);
|
|
|
$smsService->sendSms($apply['mobile'], 'sms_buyhouse_supply', ['name' => $apply['name'], 'month' => date('m', $time), 'day' => date('d', $time)]);
|
|
|
}
|
|
|
|
|
@@ -139,95 +143,37 @@ class BuyHouseZrController extends Controller
|
|
|
*/
|
|
|
public function detail(Request $request)
|
|
|
{
|
|
|
- $id = $request->id;
|
|
|
- $info = TalentHouseApply::with('idcard')->where('id',$id)->first();
|
|
|
- $info->family = json_decode($info->family);
|
|
|
+ $id = $request->id;
|
|
|
+ $info = TalentHouseApply::with('idcard')->where('id', $id)->first();
|
|
|
+ $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, 'status' => $this->status])->render();
|
|
|
+
|
|
|
+ $with = ['info' => $info, 'form_url' => route('content.buy_house_zr.audit'), 'status' => $this->status];
|
|
|
+ $with['check_status'] = $info['zr_check_status'];
|
|
|
+
|
|
|
+ $html = view('admin.ajax.buy_house_detail')->with($with)->render();
|
|
|
return response()->json(['code' => 1, 'data' => $html]);
|
|
|
}
|
|
|
}
|