|
@@ -40,11 +40,11 @@ class handleYzOrderData extends Command
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
|
|
|
- //判断价格是否符合系统售价
|
|
|
- $platform_yz_info = Db::name('platform_youzan')
|
|
|
- ->field('id,sale_price,platform_id')
|
|
|
- ->where(['skuCode' => $c_data['skuCode'], 'is_del' => 0])
|
|
|
- ->findOrEmpty();
|
|
|
+// //判断价格是否符合系统售价
|
|
|
+// $platform_yz_info = Db::name('platform_youzan')
|
|
|
+// ->field('id,sale_price,platform_id')
|
|
|
+// ->where(['skuCode' => $c_data['skuCode'], 'is_del' => 0])
|
|
|
+// ->findOrEmpty();
|
|
|
|
|
|
if ($c_data['discount_price'] < $platform_yz_info['sale_price'] && $c_data['is_approved'] == '0') {
|
|
|
Db::rollback();
|
|
@@ -162,7 +162,6 @@ class handleYzOrderData extends Command
|
|
|
->order("min_num desc")
|
|
|
->find();
|
|
|
if ($origin == false) throw new Exception('未找到相关成本价格');
|
|
|
-
|
|
|
$origin_price = $origin['nake_total'];
|
|
|
|
|
|
}
|
|
@@ -201,6 +200,15 @@ class handleYzOrderData extends Command
|
|
|
$sale_price = $act['final_price'];//取活动的相关价格
|
|
|
// if ($act['moq_num'] > $good_num) throw new Exception('商品不满足活动价起订量' . $act['moq_num']);
|
|
|
// if ($act['activity_stock'] < $good_num) throw new Exception('商品活动库存剩余' . $act['activity_stock']);
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if ($c_data['discount_price'] < $ct['sale_price'] && $c_data['is_approved'] == '0') {
|
|
|
+ Db::rollback();
|
|
|
+ $this->callbackYz(['status' => 2, 'id' => $c_data['id'], 'reason' => '价格低于系统售价' . $ct['sale_price']]);
|
|
|
+ Cache::store('redis')->set("YzTimeLimit",0);
|
|
|
+ return false;//停止执行后续代码
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// $is_activity = (int)(!empty($act));
|
|
@@ -252,7 +260,7 @@ class handleYzOrderData extends Command
|
|
|
|
|
|
$remark = $c_data['buyer_messages'];
|
|
|
|
|
|
- $user = Config::get('app.uid_platform_youzan.' . $platform_yz_info['platform_id']);
|
|
|
+ $user = Config::get('app.uid_platform_youzan.' . $ct['platform_id']);
|
|
|
$rm = isset($user['id']) ? $user['id'] : 0;
|
|
|
$ri = isset($user['nickname']) ? $user['nickname'] : 'youzan';
|
|
|
if($rm==0)throw new Exception('平台转单未找到对应的平台账户');
|