| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace bizHd\notify\classes;
- use bizHd\admin\classes\ShopAdminClass;
- use bizHd\base\classes\BaseClass;
- use Yii;
- class NotifyClass extends BaseClass
- {
- public static $baseFile = '\bizHd\notify\models\Notify';
- public static function getNotifyList($where)
- {
- $data = self::getList('*', $where, 'addTime DESC');
- return $data;
- }
- //采购获取新花材通知 ssh 20231119
- public static function cgGetNewProduct($newProduct, $mainId, $shopId, $ghs)
- {
- $ghsName = $ghs['name'] ?? '';
- $productName = $newProduct->name ?? '';
- $id = $newProduct->id ?? 0;
- $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
- if (!empty($staffList)) {
- foreach ($staffList as $staff) {
- $staffId = $staff->id;
- $data = [
- 'mainId' => $mainId,
- 'shopId' => $shopId,
- 'staffId' => $staffId,
- 'title' => '花材需要归类',
- 'type' => 1,
- 'targetId' => $id,
- 'read' => 0,
- 'content' => $ghsName . '的【' . $productName . '】,被归到默认分类',
- 'page' => '/admin/item/detail?from=1&source=notify&id=' . $id,
- ];
- self::add($data);
- $notifyNum = bcadd($staff->notifyNum, 1);
- $staff->notifyNum = $notifyNum;
- $staff->save();
- }
- }
- }
- }
|