逻辑修正:优化了采购订单列表的获取逻辑。
This commit is contained in:
parent
f5ec7fced5
commit
ee10e46bd1
@ -45,14 +45,14 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$params=$this->request->post();
|
$params = $this->request->post();
|
||||||
$order=OpurchaseclassLogic::createOpurchaseOrder(request()->userInfo,$params);
|
$order = OpurchaseclassLogic::createOpurchaseOrder(request()->userInfo, $params);
|
||||||
if($order==false){
|
if ($order == false) {
|
||||||
return $this->fail(OpurchaseclassLogic::getError());
|
return $this->fail(OpurchaseclassLogic::getError());
|
||||||
}else{
|
} else {
|
||||||
PayNotifyLogic::handle('operated', $order['number']);
|
PayNotifyLogic::handle('operated', $order['number']);
|
||||||
//推送队列
|
//推送队列
|
||||||
Redis::send('push-supplier-products', ['order_id'=>$order['id']]);
|
Redis::send('push-supplier-products', ['order_id' => $order['id']]);
|
||||||
return $this->success('支付成功');
|
return $this->success('支付成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,9 +77,9 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
public function sub_orders()
|
public function sub_orders()
|
||||||
{
|
{
|
||||||
$id = $this->request->get('id');
|
$id = $this->request->get('id');
|
||||||
$is_mer = $this->request->get('is_mer',1);
|
$is_mer = $this->request->get('is_mer', 1);
|
||||||
$page_no = $this->request->get('page_no', 1);
|
$page_no = $this->request->get('page_no', 1);
|
||||||
$result = OpurchaseclassLogic::sub_detail($id,$is_mer,$page_no);
|
$result = OpurchaseclassLogic::sub_detail($id, $is_mer, $page_no);
|
||||||
return $this->data($result);
|
return $this->data($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,13 +91,15 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
$id = $this->request->get('id');
|
$id = $this->request->get('id');
|
||||||
$page_no = $this->request->get('page_no', 1);
|
$page_no = $this->request->get('page_no', 1);
|
||||||
$page_size = $this->request->get('page_size', 15);
|
$page_size = $this->request->get('page_size', 15);
|
||||||
$is_push = $this->request->get('is_push',0);
|
$is_push = $this->request->get('is_push', 'all');
|
||||||
$where['pid']=$id;
|
if ($is_push != 'all') {
|
||||||
$where['is_push'] = $is_push;
|
$where['is_push'] = $is_push;
|
||||||
|
}
|
||||||
|
$where['pid'] = $id;
|
||||||
$res = Opurchaseinfo::where($where)->page($page_no, $page_size)->select()
|
$res = Opurchaseinfo::where($where)->page($page_no, $page_size)->select()
|
||||||
->each(function ($item) {
|
->each(function ($item) {
|
||||||
$find = Goods::where('id', $item['goods'])->with('unitName')->find();
|
$find = Goods::where('id', $item['goods'])->with('unitName')->find();
|
||||||
if($find){
|
if ($find) {
|
||||||
$item['goods_name'] = $find['name'];
|
$item['goods_name'] = $find['name'];
|
||||||
$item['unit_name'] = $find['unit_name'];
|
$item['unit_name'] = $find['unit_name'];
|
||||||
}
|
}
|
||||||
@ -107,7 +109,6 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
'is_adopt' => 1
|
'is_adopt' => 1
|
||||||
];
|
];
|
||||||
$item['nums_count'] = OpurchaseGoodsOffer::where($where)->sum('nums');
|
$item['nums_count'] = OpurchaseGoodsOffer::where($where)->sum('nums');
|
||||||
|
|
||||||
});
|
});
|
||||||
$data['count'] = Opurchaseinfo::where($where)->count();
|
$data['count'] = Opurchaseinfo::where($where)->count();
|
||||||
$data['lists'] = $res?->toArray();
|
$data['lists'] = $res?->toArray();
|
||||||
@ -134,7 +135,7 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
public function createSupplierGoods()
|
public function createSupplierGoods()
|
||||||
{
|
{
|
||||||
$id = $this->request->post('id');
|
$id = $this->request->post('id');
|
||||||
Redis::send('push-supplier-products', ['order_id'=>$id]);
|
Redis::send('push-supplier-products', ['order_id' => $id]);
|
||||||
|
|
||||||
// $result = OpurchaseclassLogic::createSupplierGoods($params);
|
// $result = OpurchaseclassLogic::createSupplierGoods($params);
|
||||||
// if (true === $result) {
|
// if (true === $result) {
|
||||||
@ -155,8 +156,8 @@ class OpurchaseclassController extends BaseAdminController
|
|||||||
$type = $this->request->post('type');
|
$type = $this->request->post('type');
|
||||||
$notes = $this->request->post('notes');
|
$notes = $this->request->post('notes');
|
||||||
$nums = $this->request->post('nums');
|
$nums = $this->request->post('nums');
|
||||||
$result = OpurchaseclassLogic::goodsOfferUpdate($id,$type,$notes,$nums);
|
$result = OpurchaseclassLogic::goodsOfferUpdate($id, $type, $notes, $nums);
|
||||||
if ($result==true) {
|
if ($result == true) {
|
||||||
return $this->success('已设置', [], 1, 1);
|
return $this->success('已设置', [], 1, 1);
|
||||||
}
|
}
|
||||||
return $this->fail(OpurchaseclassLogic::getError());
|
return $this->fail(OpurchaseclassLogic::getError());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user