|
@@ -53,18 +53,18 @@ class handleYzOrderData extends Command
|
|
|
//企业客户
|
|
|
$ct = Db::name('platform_youzan')
|
|
|
->alias('py')
|
|
|
- ->field('py.id,py.skuCode,py.spuCode,py.plat_code,co.id org1_id,co.name,py.sale_price,g.*,py.platform_id')
|
|
|
+ ->field('py.id,py.skuCode,py.spuCode,py.plat_code,p.platform_name,py.sale_price,g.*,py.platform_id')
|
|
|
->leftJoin('platform p', 'p.id=py.platform_id AND p.is_del=0')
|
|
|
- ->leftJoin('customer_org1 co', 'co.name=p.platform_name AND co.is_del=0')
|
|
|
+// ->leftJoin('customer_org1 co', 'co.name=p.platform_name AND co.is_del=0')
|
|
|
->leftJoin('good g', 'g.spuCode=py.spuCode AND g.is_del=0')
|
|
|
->where('py.skuCode', $c_data['skuCode'])
|
|
|
->where('py.exam_status', 6)//exam_status==3已上线
|
|
|
->find();
|
|
|
-
|
|
|
if ($ct) {
|
|
|
$customer_code = Db::connect('mysql_sys')
|
|
|
- ->name('customer_info')
|
|
|
- ->where(['itemid' => $ct['org1_id'], 'companyName' => $ct['name'] . '客户', 'is_del' => 0])
|
|
|
+ ->name('customer_info')->alias("a")
|
|
|
+ ->leftJoin("customer_org1 b" ,"a.itemid=b.id and b.is_del=0")
|
|
|
+ ->where(['companyName' => $ct['platform_name'] . '客户', "b.name"=>$ct['platform_name'], 'a.is_del' => 0])
|
|
|
->value('companyNo', '');
|
|
|
|
|
|
if (!$customer_code) throw new Exception('在企业客户管理组织中找不到对应的企业');
|
|
@@ -157,7 +157,7 @@ class handleYzOrderData extends Command
|
|
|
"good_code" => $spuCode,
|
|
|
"skuCode" => $skuCode,
|
|
|
"customer_code" => $customer_code,
|
|
|
- "customerName" => $ct['name'] . '客户',
|
|
|
+ "customerName" => $ct['platform_name'] . '客户',
|
|
|
"good_name" => isset($goodinfo['good_name']) && $goodinfo['good_name'] !== '' ? $goodinfo['good_name'] : '',
|
|
|
"good_num" => $good_num,
|
|
|
"cat_id" => $goodinfo['cat_id'],
|