|
@@ -5,6 +5,7 @@ namespace App\Admin\Controllers\Content;
|
|
|
use App\Http\Controllers\Controller;
|
|
|
use App\Models\TalentHouse;
|
|
|
use App\Models\TalentHouseApply;
|
|
|
+use App\Services\Common\SmsService;
|
|
|
use Encore\Admin\Controllers\HasResourceActions;
|
|
|
use Encore\Admin\Grid;
|
|
|
use Encore\Admin\Layout\Content;
|
|
@@ -40,7 +41,7 @@ class BuyHouseJcController extends Controller
|
|
|
{
|
|
|
$grid = new Grid(new TalentHouseApply());
|
|
|
|
|
|
- $grid->model()->with('house')->where('type',2)->where('is_back',2)->where('is_draft',2)->orderBy('rs_check_status', 'ASC');
|
|
|
+ $grid->model()->with('house')->where('type', 2)->where('is_back', 2)->where('is_draft', 2)->orderBy('rs_check_status', 'ASC');
|
|
|
|
|
|
$status_text = $this->status;
|
|
|
$grid->id('ID');
|
|
@@ -78,7 +79,7 @@ class BuyHouseJcController extends Controller
|
|
|
/**
|
|
|
* 审核
|
|
|
*/
|
|
|
- public function audit(Request $request)
|
|
|
+ public function audit(Request $request, SmsService $smsService)
|
|
|
{
|
|
|
$id = $request->id;
|
|
|
$status = $request->status;
|
|
@@ -95,6 +96,15 @@ class BuyHouseJcController extends Controller
|
|
|
'rs_check_time' => date('Y-m-d H:i:s'),
|
|
|
'status' => $status == 2 ? 1 : 3,
|
|
|
]);
|
|
|
+
|
|
|
+ //审核不通过发送短信
|
|
|
+ if ($status == 3) {
|
|
|
+ $apply = TalentHouseApply::find($id);
|
|
|
+ $house = TalentHouse::find($apply['house_id']);
|
|
|
+ $time = strtotime($house['supply_time']);
|
|
|
+ $smsService->sendSms($apply['mobile'], 'sms_buyhouse_supply', ['name' => $apply['name'], 'month' => date('m', $time), 'day' => date('d', $time)]);
|
|
|
+ }
|
|
|
+
|
|
|
if ($result) {
|
|
|
admin_toastr('审核成功', 'success');
|
|
|
} else {
|
|
@@ -109,8 +119,8 @@ class BuyHouseJcController extends Controller
|
|
|
*/
|
|
|
public function detail(Request $request)
|
|
|
{
|
|
|
- $id = $request->id;
|
|
|
- $info = TalentHouseApply::with('idcard')->where('id',$id)->first();
|
|
|
+ $id = $request->id;
|
|
|
+ $info = TalentHouseApply::with('idcard')->where('id', $id)->first();
|
|
|
$info->family = json_decode($info->family);
|
|
|
$info->marry_text = $this->marry[$info->marry];
|
|
|
|