|
|
@@ -169,4 +169,31 @@ class ChatController extends BaseController
|
|
|
$c = ChatService::getUnReadMsgCount($this->shopId, 'message');
|
|
|
util::success(['msg_count'=>$c]);
|
|
|
}
|
|
|
+
|
|
|
+ // 给暂无价格商品报价
|
|
|
+ public function actionsCreateQuotedPrice()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $key = $post['key'];
|
|
|
+ $price = floatval($post['price']);
|
|
|
+ $keyArr = explode('-', $key);
|
|
|
+ $shopId = intval($keyArr[0]);
|
|
|
+ if($this->shopId != $shopId){
|
|
|
+ util::error(-1, '校验失败,并不是你的客户');
|
|
|
+ }
|
|
|
+
|
|
|
+ $goodsId = $keyArr[2];
|
|
|
+ $goods = GoodsClass::getById($goodsId, fasle, 'id, priceType');
|
|
|
+ if ($goods['priceType'] != 0) {
|
|
|
+ util::error(-1, '此商品无需走报价');
|
|
|
+ }
|
|
|
+
|
|
|
+ $val = Yii::$app->redis->executeCommand('GET', [$key]);
|
|
|
+ if (!empty($saveAuthCode)) { // 修改报价
|
|
|
+ Yii::info('修改报价:' . $key . ' -- 旧价:' . $val . ', 新价:' . $price);
|
|
|
+ }
|
|
|
+
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$key, 864000, $price]);
|
|
|
+ util::success(['oldPice'=>$val, 'newPrice'=>$price]);
|
|
|
+ }
|
|
|
}
|