Commit 4aa46722 by duwenjun

我的报价展示供应商信息

parent 94f8cd52
......@@ -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);
......
......@@ -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() : [];
}
}
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