|
|
@ -3,6 +3,7 @@ |
|
|
namespace App\Admin\Controllers; |
|
|
namespace App\Admin\Controllers; |
|
|
|
|
|
|
|
|
use App\Admin\Repositories\ImsCjdcMarket; |
|
|
use App\Admin\Repositories\ImsCjdcMarket; |
|
|
|
|
|
use App\Models\LanzuArea; |
|
|
use App\Models\LanzuMmInfo; |
|
|
use App\Models\LanzuMmInfo; |
|
|
use App\Models\v3\Market; |
|
|
use App\Models\v3\Market; |
|
|
use Dcat\Admin\Admin; |
|
|
use Dcat\Admin\Admin; |
|
|
@ -83,7 +84,7 @@ class ImsCjdcMarketController extends AdminController |
|
|
*/ |
|
|
*/ |
|
|
protected function detail($id) |
|
|
protected function detail($id) |
|
|
{ |
|
|
{ |
|
|
return Show::make($id, new ImsCjdcMarket(), function (Show $show) { |
|
|
|
|
|
|
|
|
return Show::make($id, new Market(), function (Show $show) { |
|
|
|
|
|
|
|
|
if (!\Admin::user()->isAdministrator() && $show->model()->mp_id == 0) { |
|
|
if (!\Admin::user()->isAdministrator() && $show->model()->mp_id == 0) { |
|
|
$show->panel() |
|
|
$show->panel() |
|
|
@ -103,23 +104,8 @@ class ImsCjdcMarketController extends AdminController |
|
|
$show->addtime('创建时间'); |
|
|
$show->addtime('创建时间'); |
|
|
$show->sort; |
|
|
$show->sort; |
|
|
$show->status()->using([0=>'禁用',1=>'正常']); |
|
|
$show->status()->using([0=>'禁用',1=>'正常']); |
|
|
$show->coordinates; |
|
|
|
|
|
$show->remark; |
|
|
$show->remark; |
|
|
$show->address; |
|
|
$show->address; |
|
|
$show->poundage; |
|
|
|
|
|
$show->dn_poundage; |
|
|
|
|
|
$show->dm_poundage; |
|
|
|
|
|
$show->yd_poundage; |
|
|
|
|
|
$show->loudspeaker_imei; |
|
|
|
|
|
$show->dishes_menu_intro; |
|
|
|
|
|
$show->create_time->as(function ($time){ |
|
|
|
|
|
if ($time){ |
|
|
|
|
|
return date('Y-m-d H:i',$time); |
|
|
|
|
|
}else{ |
|
|
|
|
|
return '-'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
$show->created_at->as(function ($time){ |
|
|
$show->created_at->as(function ($time){ |
|
|
if ($time){ |
|
|
if ($time){ |
|
|
return date('Y-m-d H:i',$time); |
|
|
return date('Y-m-d H:i',$time); |
|
|
@ -151,6 +137,11 @@ class ImsCjdcMarketController extends AdminController |
|
|
$form->text('name')->required(); |
|
|
$form->text('name')->required(); |
|
|
$form->select('mp_id', '服务商')->options('/api/getMpInfo')->required(); |
|
|
$form->select('mp_id', '服务商')->options('/api/getMpInfo')->required(); |
|
|
$form->mobile('tel','电话')->required(); |
|
|
$form->mobile('tel','电话')->required(); |
|
|
|
|
|
$form->select('province_id','省') |
|
|
|
|
|
->options('/api/area')->required() |
|
|
|
|
|
->load('city_id','/api/area'); |
|
|
|
|
|
$form->select('city_id','市')->required()->load('region_id','/api/area'); |
|
|
|
|
|
$form->select('region_id','区')->required(); |
|
|
$form->text('address')->required(); |
|
|
$form->text('address')->required(); |
|
|
if ($form->isEditing()){ |
|
|
if ($form->isEditing()){ |
|
|
$form->text('coordinates') |
|
|
$form->text('coordinates') |
|
|
@ -164,6 +155,7 @@ class ImsCjdcMarketController extends AdminController |
|
|
->placeholder('输入 经纬度,如: 108.281552,22.83731') |
|
|
->placeholder('输入 经纬度,如: 108.281552,22.83731') |
|
|
->help("通过网址 <a href='https://lbs.amap.com/console/show/picker' target='_blank'>https://lbs.amap.com/console/show/picker</a> 获取经纬度"); |
|
|
->help("通过网址 <a href='https://lbs.amap.com/console/show/picker' target='_blank'>https://lbs.amap.com/console/show/picker</a> 获取经纬度"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$form->number('sort', '排序'); |
|
|
$form->number('sort', '排序'); |
|
|
$form->switch('status', '状态'); |
|
|
$form->switch('status', '状态'); |
|
|
$form->image('logo')->required(); |
|
|
$form->image('logo')->required(); |
|
|
@ -178,7 +170,7 @@ class ImsCjdcMarketController extends AdminController |
|
|
$form->lat = $coordinates[1]; |
|
|
$form->lat = $coordinates[1]; |
|
|
$form->deleteInput('coordinates'); |
|
|
$form->deleteInput('coordinates'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form->deleting(function (Form $form){ |
|
|
$form->deleting(function (Form $form){ |
|
|
//删除市场前,校验该市场下是否存在市场经理
|
|
|
//删除市场前,校验该市场下是否存在市场经理
|
|
|
$mids = array_column($form->model()->toArray(), 'id'); |
|
|
$mids = array_column($form->model()->toArray(), 'id'); |
|
|
@ -206,4 +198,6 @@ class ImsCjdcMarketController extends AdminController |
|
|
} |
|
|
} |
|
|
return response()->json($ret); |
|
|
return response()->json($ret); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |