Commit d1b63cb4 by 连敬荣

Merge branch 'master' into 'feature/lianjingrong/20210524'

# Conflicts:
#   config/website.php
parents 1693714e e61836c3
......@@ -190,7 +190,15 @@ class QuoteModel extends Model
$map['create_uid'] = isset($input['create_uid']) ? $input['create_uid'] : ''; // 报价制单人
if ($type == 1) {
$list = $list->where('q.create_uid', $input['user_id'])->whereNotIn('q.status', [0, -1]); // 过滤报价草稿
// 如果有绑定供应商,那么展示供应商数据
$user_id = $input['user_id'] ? $input['user_id'] : 0;
$bind_supplier_info = SupplierChannelComModel::getSupplierInfoByUid($user_id);
if ($bind_supplier_info){
$list = $list->where('q.supplier_id', $bind_supplier_info['supplier_id'])->whereNotIn('q.status', [0, -1]); // 过滤报价草稿
} else {
$list = $list->where('q.create_uid', $input['user_id'])->whereNotIn('q.status', [0, -1]); // 过滤报价草稿
}
// 如果是云芯的,过滤已删除状态
if (RequestHelper::getClientType() == AppType::APPTYPE_YUNXIN){
$list = $list->where('q.status', '<>', QuoteModel::STATUS_DEL);
......@@ -515,11 +523,11 @@ class QuoteModel extends Model
if ($quote_info['status'] == self::STATUS_CLOSE) {
return [1, '关闭失败,该报价已关闭,请刷新页面查看'];
}
if ($quote_info['status'] !== self::STATUS_OFFER) {
if (!in_array($quote_info['status'], [self::STATUS_OFFER, self::STATUS_SELECTED, self::STATUS_SURE])) {
return [1, '关闭失败,该报价状态不能关闭'];
}
$res = $this->where('id', $id)->where('status', self::STATUS_OFFER)->update(['status' => self::STATUS_CLOSE]);
$res = $this->where('id', $id)->whereIn('status', [self::STATUS_OFFER, self::STATUS_SELECTED, self::STATUS_SURE])->update(['status' => self::STATUS_CLOSE]);
// 查看当前询价明细的报价数量,若为0,则更新询价明细状态为待报价
$count = $this->where('inquiry_items_id', $quote_info['inquiry_items_id'])->whereNotIn('status', [self::STATUS_CANCEL, self::STATUS_CLOSE, self::STATUS_DEL])->count();
$InquiryItemsModel = new InquiryItemsModel;
......
......@@ -23,4 +23,10 @@ class SupplierChannelComModel extends Model
echo json_encode($brandInfo,JSON_UNESCAPED_UNICODE) ;
exit();
}
public static function getSupplierInfoByUid($uid)
{
$res = self::where('yunxin_channel_uid', $uid)->first();
return ($res) ? $res->toArray() : [];
}
}
......@@ -13,8 +13,7 @@ return [
'search'=> $domain_config['domain']['login_domain'] . '/api/search',
'dashboard'=> $domain_config['domain']['login_domain'] . '/dashboard',
],
//////////////////////
// "search_url"=>"http://soso12.ichunt.com", //本地235数据库
"search_url"=> $domain_config['domain']['search_url'],
////////////////本地配置////////////////////
'export_source_items_id' => "30", //导出来源明细id
'company_info_origin'=>[ #原始公司信息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment