...
|
...
|
@@ -33,12 +33,12 @@ class Order extends Frontend |
|
|
public function confirm(){
|
|
|
$user_id = $this->auth->id;
|
|
|
// $car_ids = $this->request->param('car_ids');
|
|
|
$data = $this->request->param('data');
|
|
|
$car_data = $this->request->param('data');
|
|
|
$province_id = $this->request->param('province_id',0,'intval');
|
|
|
if(empty($data) || empty($province_id)){
|
|
|
if(empty($car_data) || empty($province_id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = json_decode($data,true);
|
|
|
// $data = json_decode($data,true);
|
|
|
/*if(!empty($car_ids)){
|
|
|
$car_ids = explode(',',$car_ids);
|
|
|
$carModel = new \app\index\model\Car();
|
...
|
...
|
@@ -47,6 +47,8 @@ class Order extends Frontend |
|
|
$this->error('sql执行失败');
|
|
|
}
|
|
|
}*/
|
|
|
$car_model = new \app\index\model\Car();
|
|
|
$data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_data)->select();
|
|
|
$goodsModel = new \app\index\model\Goods();
|
|
|
$goods_price = [];
|
|
|
$store_ids = [];
|
...
|
...
|
@@ -123,7 +125,8 @@ class Order extends Frontend |
|
|
$this->assign('goods_total',$goods_total1);
|
|
|
$this->assign('postage_total',$postage_total1);
|
|
|
$this->assign('address',$address);
|
|
|
$this->assign('data',json_encode($data));
|
|
|
// $this->assign('data',json_encode($data));
|
|
|
$this->assign('data',$car_data);
|
|
|
$this->assign('province_id',$province_id);
|
|
|
$this->assign('title','确认订单');
|
|
|
return $this->fetch();
|
...
|
...
|
@@ -227,7 +230,7 @@ class Order extends Frontend |
|
|
$express = $this->request->param('express',0,'intval');
|
|
|
$address_id = $this->request->param('address_id',0,'intval');
|
|
|
$pay_type = $this->request->param('pay_type',0,'intval');
|
|
|
$car_ids = $this->request->param('car_ids');
|
|
|
$car_ids = $this->request->param('data');
|
|
|
$province_id = $this->request->param('province_id',0,'intval');
|
|
|
if(empty($data) || empty($express) || empty($pay_type) || empty($province_id)){
|
|
|
$this->error('缺少必要参数');
|
...
|
...
|
@@ -239,12 +242,14 @@ class Order extends Frontend |
|
|
$addressModel = new Address();
|
|
|
$address = $addressModel->findData(['id'=>$address_id]);
|
|
|
}
|
|
|
$data = json_decode($data,true);
|
|
|
$car_model = new \app\index\model\Car();
|
|
|
$data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_ids)->select();
|
|
|
// $data = json_decode($data,true);
|
|
|
Db::startTrans();
|
|
|
if(!empty($car_ids)){
|
|
|
$car_ids = explode(',',$car_ids);
|
|
|
$carModel = new \app\index\model\Car();
|
|
|
$result = $carModel->where(['id'=>$car_ids])->delete();
|
|
|
$result = $carModel->whereIn('id',$car_ids)->delete();
|
|
|
if(empty($result)){
|
|
|
$this->error('sql执行失败');
|
|
|
}
|
...
|
...
|
|