You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php
namespace App\Admin\Forms;
use App\Models\ImsCjdcOrderMain;use App\Models\LanzuServiceHorseman;use App\Models\v3\LanzuEmployees;use Dcat\Admin\Widgets\Form;use Symfony\Component\HttpFoundation\Response;
class SelectHorseman extends Form{
/** * Handle the form request. * * @param array $input * * @return Response */ protected $orderId; public function handle(array $input) { $hid = request()->get('horseman_id'); $oid = request()->get('order_id'); $current_page = request()->get('current_page'); $result = ImsCjdcOrderMain::where('id',$oid)->update(['shipping_type'=>1,'horseman_id'=>$hid,'updated_at'=>time()]); if ($result){ return $this->success('操作成功',"order?page={$current_page}"); }else{ return $this->error('操作失败'); } }
/** * Build a form here. */ public function form() { $this->select('horseman_id','配送员') ->options(LanzuEmployees::getHorseman()) ->required(); $this->hidden('order_id')->value($this->data['order_id']); $this->hidden('current_page')->value($this->data['current_page']); }
/** * The data of the form. * * @return array */ public function default() {
}
}
|