2024-05-08 16:42:07 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\api\controller\operation;
|
|
|
|
|
|
|
|
use app\api\controller\BaseApiController;
|
|
|
|
use app\api\lists\operation\OpurchaseGoodsOfferList;
|
|
|
|
use app\api\logic\operation\OpurchaseGoodsOfferLogic;
|
|
|
|
use app\api\validate\OpurchaseGoodsOfferValidate;
|
|
|
|
|
|
|
|
class OpurchaseGoodsOfferController extends BaseApiController
|
|
|
|
{
|
|
|
|
public function list(){
|
|
|
|
return $this->dataLists(new OpurchaseGoodsOfferList());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function offer(){
|
2024-05-08 18:00:04 +08:00
|
|
|
if(!$this->request->userInfo['supplier']) return $this->fail('非供应商用户不能报价');
|
2024-05-08 16:42:07 +08:00
|
|
|
$params = (new OpurchaseGoodsOfferValidate())->post()->goCheck('offer');
|
|
|
|
$result = OpurchaseGoodsOfferLogic::offer($params);
|
|
|
|
if (true === $result) {
|
|
|
|
return $this->success('报价成功', [], 1, 1);
|
|
|
|
}
|
|
|
|
return $this->fail(OpurchaseGoodsOfferLogic::getError());
|
|
|
|
}
|
|
|
|
}
|