dataLists(new OpurchaseGoodsOfferList()); } /** * 创建报价 */ public function create_price() { $id = $this->request->post('id'); $price = $this->request->post('price'); $nums = $this->request->post('nums'); $supplier_id = $this->request->userInfo['supplier']['id']; if (!$supplier_id) return $this->fail('请先绑定供应商'); $res = OpurchaseGoodsOffer::where('supplier_id', $supplier_id)->where('id', $id)->update(['price' => $price, 'nums' => $nums]); if ($res) return $this->success('报价成功'); return $this->fail('报价失败'); } /** * 提交物流 */ public function express() { $delivery_name = $this->request->post('delivery_name'); $delivery_id = $this->request->post('delivery_id'); $supplier_id = $this->request->userInfo['supplier']['id']; if (!$supplier_id) return $this->fail('请先绑定供应商'); $data = [ 'delivery_name' => $delivery_name, 'delivery_id' => $delivery_id, 'supplier_id'=>$supplier_id, ]; $res = OpurchaseGoodsOfferLogic::express($data); if (true === $res) { return $this->success('提交成功', [], 1, 1); } return $this->fail(OpurchaseGoodsOfferLogic::getError()); } }