32 lines
976 B
PHP
32 lines
976 B
PHP
<?php
|
|
|
|
namespace app\api\controller\operation;
|
|
use app\api\controller\BaseApiController;
|
|
use app\api\lists\operation\OpurchaseGoodsOfferList;
|
|
use app\common\model\opurchase\OpurchaseGoodsOffer;
|
|
|
|
class OpurchaseclassController extends BaseApiController{
|
|
|
|
/**
|
|
* 报价列表
|
|
*/
|
|
public function goods_offer_list(){
|
|
|
|
return $this->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('报价失败');
|
|
}
|
|
|
|
} |