|
|
@@ -12,6 +12,7 @@ use bizGhs\custom\classes\CustomClass;
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\item\classes\ItemClassClass;
|
|
|
use bizGhs\merchant\classes\ShopClass;
|
|
|
+use bizGhs\notify\classes\NotifyClass;
|
|
|
use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
use bizGhs\product\classes\ProductClass;
|
|
|
use bizGhs\product\models\Product;
|
|
|
@@ -1102,6 +1103,25 @@ class ProductController extends BaseController
|
|
|
$ptItemId = $respond['itemId'] ?? 0;
|
|
|
$ptItemInfo = PtItemClass::getById($ptItemId);
|
|
|
$respond['ptItemInfo'] = $ptItemInfo;
|
|
|
+
|
|
|
+ if ($respond['mainId'] == $this->mainId) {
|
|
|
+ $staff = $this->shopAdmin;
|
|
|
+ $staffId = $this->shopAdminId;
|
|
|
+ $notify = NotifyClass::getByCondition(['staffId' => $staffId, 'type' => 1, 'targetId' => $id], true);
|
|
|
+ if (!empty($notify)) {
|
|
|
+ if ($notify->read == 0) {
|
|
|
+ $notify->read = 1;
|
|
|
+ $notify->save();
|
|
|
+ $notifyNum = $staff->notifyNum;
|
|
|
+ if ($notifyNum > 0) {
|
|
|
+ $notifyNum--;
|
|
|
+ $staff->notifyNum = $notifyNum;
|
|
|
+ $staff->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
util::success($respond);
|
|
|
}
|
|
|
|