Browse Source

修复自送bug

master
lanzu_qinsheng 5 years ago
parent
commit
5c529562a6
  1. 5
      app/Admin/Controllers/ImsCjdcOrderMainController.php
  2. 21
      app/Admin/Forms/SelectHorseman.php

5
app/Admin/Controllers/ImsCjdcOrderMainController.php

@ -58,7 +58,10 @@ class ImsCjdcOrderMainController extends AdminController
$grid->money;
$grid->column('market.name', '所属市场');
$grid->pay_time('支付时间')->display(function ($time) {
return date('Y-m-d H:i:s',$time);
if ($time){
return date('Y-m-d H:i:s',$time);
}
return '未支付';
});
$grid->created_at('下单时间')->display(function ($time) {
return date('Y-m-d H:i:s',$time);

21
app/Admin/Forms/SelectHorseman.php

@ -5,6 +5,8 @@ namespace App\Admin\Forms;
use App\Models\ImsCjdcOrderMain;
use App\Models\LanzuServiceHorseman;
use App\Models\v3\LanzuEmployees;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;
use Symfony\Component\HttpFoundation\Response;
@ -21,8 +23,9 @@ class SelectHorseman extends Form
protected $orderId;
public function handle(array $input)
{
$hid = request()->get('horseman_id');
$oid = request()->get('order_id');
$hid = request()->input('horseman_id');
$oid = request()->input('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){
@ -40,18 +43,10 @@ class SelectHorseman extends 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()
{
$this->text('order_id');
$this->text('current_page');
}
}
Loading…
Cancel
Save