代购新增删除
This commit is contained in:
parent
49aa6bb1dd
commit
003d76c504
@ -265,6 +265,9 @@ class StoreCartDg extends BaseController
|
||||
$goods = Db::table('eb_store_cart')->alias('a')->join('eb_store_product b','a.product_id = b.product_id')->field("sum(b.price*a.cart_num) as total_price")->where($www3)->find();
|
||||
return $goods['total_price'];
|
||||
})
|
||||
->withAttr('create_time',function ($value,$data){
|
||||
return date('Y-m-d H:i:s',$data['create_time']);
|
||||
})
|
||||
->order('id desc')
|
||||
->select();
|
||||
if($list){
|
||||
@ -274,6 +277,32 @@ class StoreCartDg extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DbException
|
||||
* @author Qinii
|
||||
* 删除保存的未付款代购
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$id = $this->request->param('id');
|
||||
if(empty($id)){
|
||||
return app('json')->fail('参数错误');
|
||||
}
|
||||
$where['id'] = $id;
|
||||
$where['uid'] = $this->request->uid();
|
||||
$res = Db::table('eb_store_cart_dg_nopay')
|
||||
->where($where)
|
||||
->delete();
|
||||
|
||||
if($res){
|
||||
return app('json')->success('删除成功');
|
||||
}else{
|
||||
return app('json')->fail('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
|
@ -221,6 +221,7 @@ Route::group('api/', function () {
|
||||
Route::post('/edit', 'StoreCartDg/edit');
|
||||
Route::post('/save', 'StoreCartDg/save');
|
||||
Route::post('/get_list', 'StoreCartDg/get_list');
|
||||
Route::post('/del', 'StoreCartDg/del');
|
||||
})->prefix('api.store.order.');
|
||||
|
||||
Route::group('store/product', function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user