|
@@ -6,6 +6,7 @@ use app\admin\model\ActionLog;
|
|
|
use app\admin\model\ChangeLog;
|
|
|
use app\admin\model\ProcessOrder;
|
|
|
use app\BaseController;
|
|
|
+use app\youzan\model\PlatformYouzan;
|
|
|
use think\facade\Db;
|
|
|
|
|
|
//商品模块
|
|
@@ -1571,5 +1572,34 @@ class Good extends BaseController
|
|
|
return json_show(0, "获取成功", $list);
|
|
|
}
|
|
|
|
|
|
+ //判断是否允许修改成本信息和基础信息
|
|
|
+ public function checkIsUpdate()
|
|
|
+ {
|
|
|
+ $spuCode = $this->request->post('spuCode', '', 'trim');
|
|
|
+ if ($spuCode == '') return json_show(1004, '成本商品编号不能为空');
|
|
|
+
|
|
|
+ $is_allow_update = 1;
|
|
|
+ //检查是否有上线记录
|
|
|
+ $rs = Db::name('good_platform')
|
|
|
+ ->field('id')
|
|
|
+ ->where(['spuCode' => $spuCode, 'is_del' => 0])
|
|
|
+ ->whereNotIn('exam_status', [0, 8])
|
|
|
+ ->find();
|
|
|
+
|
|
|
+ if (!empty($rs)) $is_allow_update = 0;
|
|
|
+ else {
|
|
|
+
|
|
|
+ $rs = PlatformYouzan::field('id')
|
|
|
+ ->where(['spuCode' => $spuCode, 'is_del' => PlatformYouzan::$del_normal])
|
|
|
+ ->whereNotIn('exam_status', [PlatformYouzan::$exam_status_8,PlatformYouzan::$exam_status_2])
|
|
|
+ ->findOrEmpty()
|
|
|
+ ->isEmpty();
|
|
|
+ if (!$rs) $is_allow_update = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return json_show(0, '请求成功', ['is_allow_update' => $is_allow_update]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|