|
@@ -348,16 +348,17 @@ class OrderImport extends Base
|
|
|
} else throw new Exception('该平台商品编号找不到对应平台数据');
|
|
|
|
|
|
//企业客户
|
|
|
- $co_id = Db::name('good_platform')
|
|
|
+ $co = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code AND p.is_del=0')
|
|
|
->leftJoin('customer_org1 co', 'co.name=p.platform_name AND co.is_del=0')
|
|
|
- ->where('gp.plat_code', $param['plat_code'])
|
|
|
- ->value('co.id', 0);
|
|
|
+ ->where('gp.plat_code', $rs['plat_code'])
|
|
|
+ ->field('co.id,co.name')
|
|
|
+ ->find();
|
|
|
|
|
|
- if ($co_id) {
|
|
|
+ if ($co) {
|
|
|
$customer_code = Db::name('customer_info')
|
|
|
- ->where(['itemid' => $co_id, 'companyName' => '客户', 'is_del' => 0])
|
|
|
+ ->where(['itemid' => $co['id'], 'companyName' => $co['name'] . '客户', 'is_del' => 0])
|
|
|
->value('companyNo', '');
|
|
|
|
|
|
if ($customer_code) $extend_insert_data['customer_code'] = $customer_code;
|