调整APP版本表单链接地址
parent
44554f980e
commit
90606ecc44
|
|
@ -104,10 +104,20 @@ class AppVersionController extends AdminController
|
|||
$form->number('v')->min(0);
|
||||
$form->radio('cate')
|
||||
->when(1, function (Form $form) {
|
||||
$form->text('apk_link1')->rules('required_if:cate,1', ['required_if'=>'苹果平台需要填写苹果商店地址']);
|
||||
$form->text('apk_link1')->rules('required_if:cate,1', ['required_if'=>'苹果平台需要填写苹果商店地址'])->customFormat(function ($v) {
|
||||
if ($this->model()->cate == 1) {
|
||||
$v = $this->model()->apk_link;
|
||||
}
|
||||
return $v;
|
||||
});
|
||||
})
|
||||
->when([2, 3], function (Form $form) {
|
||||
$form->text('apk_link_text', '链接地址');
|
||||
$form->text('apk_link_text', '链接地址')->customFormat(function ($v) {
|
||||
if (in_array($this->model()->cate, [2, 3])) {
|
||||
$v = $this->model()->apk_link;
|
||||
}
|
||||
return $v;
|
||||
});
|
||||
$form->file('apk_link2')->chunked()
|
||||
->accept('apk', 'apk/*')
|
||||
->move('app-vesrion/apk/'.Carbon::now()->toDateString())
|
||||
|
|
@ -115,12 +125,7 @@ class AppVersionController extends AdminController
|
|||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoSave(false)
|
||||
->autoUpload()->customFormat(function ($v) {
|
||||
if (in_array($this->model()->cate, [2, 3])) {
|
||||
$v = $this->model()->apk_link;
|
||||
}
|
||||
return $v;
|
||||
});
|
||||
->autoUpload();
|
||||
})
|
||||
->options([
|
||||
1=>'苹果',
|
||||
|
|
|
|||
Loading…
Reference in New Issue