diff --git a/crmeb/app/Request.php b/crmeb/app/Request.php index 6fe688b84..7fc6d700f 100644 --- a/crmeb/app/Request.php +++ b/crmeb/app/Request.php @@ -29,19 +29,26 @@ class Request extends \think\Request { use Macroable; + /** + * 不过滤变量名 + * @var array + */ + protected $except = ['menu_path', 'api_url', 'unique_auth', 'description', 'custom_form']; + /** * 获取请求的数据 * @param array $params * @param bool $suffix + * @param bool $filter * @return array */ - public function more(array $params, bool $suffix = false): array + public function more(array $params, bool $suffix = false, bool $filter = true): array { $p = []; $i = 0; foreach ($params as $param) { if (!is_array($param)) { - $p[$suffix == true ? $i++ : $param] = $this->param($param); + $p[$suffix == true ? $i++ : $param] = $this->filterWord(is_string($this->param($param)) ? trim($this->param($param)) : $this->param($param), $filter && !in_array($param, $this->except)); } else { if (!isset($param[1])) $param[1] = null; if (!isset($param[2])) $param[2] = ''; @@ -52,32 +59,65 @@ class Request extends \think\Request $name = is_array($param[1]) ? $param[0] . '/a' : $param[0]; $keyName = $param[0]; } - $p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->param($name, $param[1], $param[2]); + $p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->filterWord(is_string($this->param($name, $param[1], $param[2])) ? trim($this->param($name, $param[1], $param[2])) : $this->param($name, $param[1], $param[2]), $filter && !in_array($keyName, $this->except)); } } return $p; } + /** + * 过滤接受的参数 + * @param $str + * @param bool $filter + * @return array|mixed|string|string[] + */ + public function filterWord($str, bool $filter = true) + { + if (!$str || !$filter) return $str; + // 把数据过滤 + $farr = [ + "/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU", + "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU", + "/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is" + ]; + if (is_array($str)) { + foreach ($str as &$v) { + if (is_array($v)) { + foreach ($v as &$vv) { + if (!is_array($vv)) $vv = preg_replace($farr, '', $vv); + } + } else { + $v = preg_replace($farr, '', $v); + } + } + } else { + $str = preg_replace($farr, '', $str); + } + return $str; + } + /** * 获取get参数 * @param array $params * @param bool $suffix + * @param bool $filter * @return array */ - public function getMore(array $params, bool $suffix = false): array + public function getMore(array $params, bool $suffix = false, bool $filter = true): array { - return $this->more($params, $suffix); + return $this->more($params, $suffix, $filter); } /** * 获取post参数 * @param array $params * @param bool $suffix + * @param bool $filter * @return array */ - public function postMore(array $params, bool $suffix = false): array + public function postMore(array $params, bool $suffix = false, bool $filter = true): array { - return $this->more($params, $suffix); + return $this->more($params, $suffix, $filter); } /** diff --git a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php index 2d4216335..90f25e766 100644 --- a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php +++ b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php @@ -291,7 +291,8 @@ class StoreProduct extends AuthController ['type', 1], ['is_live', 0], ['is_new', ''], - ['is_virtual', -1] + ['is_virtual', -1], + ['is_presale', -1] ]); $where['is_show'] = 1; $where['is_del'] = 0; diff --git a/crmeb/app/api/controller/v1/PublicController.php b/crmeb/app/api/controller/v1/PublicController.php index 6cf9c38ff..a152386f9 100644 --- a/crmeb/app/api/controller/v1/PublicController.php +++ b/crmeb/app/api/controller/v1/PublicController.php @@ -429,9 +429,9 @@ class PublicController ['priceOrder', ''], ['newsOrder', ''], ['salesOrder', ''], - [['type', 0], 0], + [['type', 'd'], 0], ['ids', ''], - ['selectId', ''], + [['selectId', 'd'], ''], ['selectType', 0], ['isType', 0], ]); diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 4756651f2..9c5019da2 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -576,6 +576,7 @@ class StoreOrderController $order['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 $order['pay_weixin_open'] = (int)sys_config('pay_weixin_open') ?? 0;//微信支付 1 开启 0 关闭 $order['ali_pay_status'] = (bool)sys_config('ali_pay_status');//支付包支付 1 开启 0 关闭 + $order['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 $orderData = $this->services->tidyOrder($order, true, true); $vipTruePrice = 0; foreach ($orderData['cartInfo'] ?? [] as $key => $cart) { diff --git a/crmeb/app/dao/BaseDao.php b/crmeb/app/dao/BaseDao.php index a78c880c2..3e9e1c086 100644 --- a/crmeb/app/dao/BaseDao.php +++ b/crmeb/app/dao/BaseDao.php @@ -255,7 +255,7 @@ abstract class BaseDao */ public function saveAll(array $data) { - return $this->getModel()::insertAll($data); + return $this->getModel()->saveAll($data); } /** diff --git a/crmeb/app/dao/article/ArticleDao.php b/crmeb/app/dao/article/ArticleDao.php index ad01bd32d..6e739f8ae 100644 --- a/crmeb/app/dao/article/ArticleDao.php +++ b/crmeb/app/dao/article/ArticleDao.php @@ -12,6 +12,7 @@ namespace app\dao\article; use app\dao\BaseDao; use app\model\article\Article; +use think\exception\ValidateException; /** * 文章dao @@ -56,6 +57,7 @@ class ArticleDao extends BaseDao public function read($id) { $data = $this->search()->with(['content', 'storeInfo', 'cateName'])->find($id); + if (!$data) throw new ValidateException('文章不存在'); $data['store_info'] = $data['storeInfo']; return $data; } diff --git a/crmeb/app/dao/wechat/WechatQrcodeDao.php b/crmeb/app/dao/wechat/WechatQrcodeDao.php index d33c767f7..79debe4dd 100644 --- a/crmeb/app/dao/wechat/WechatQrcodeDao.php +++ b/crmeb/app/dao/wechat/WechatQrcodeDao.php @@ -30,7 +30,7 @@ class WechatQrcodeDao extends BaseDao public function getList($where, $page = 0, $limit = 0) { return $this->search($where)->with(['user', 'record' => function ($query) { - $query->where('is_follow', 1)->field('qid,count(distinct uid) as number')->bind(['y_follow' => 'number']); + $query->where('is_follow', 1)->whereDay('add_time', 'yesterday')->field('qid,count(distinct uid) as number')->bind(['y_follow' => 'number']); }])->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); })->order('id desc')->select()->toArray(); @@ -47,4 +47,4 @@ class WechatQrcodeDao extends BaseDao $query->inc('follow'); })->update(); } -} \ No newline at end of file +} diff --git a/crmeb/app/listener/notice/Notice.php b/crmeb/app/listener/notice/Notice.php index 8229d0feb..c38017392 100644 --- a/crmeb/app/listener/notice/Notice.php +++ b/crmeb/app/listener/notice/Notice.php @@ -462,7 +462,7 @@ class Notice implements ListenerInterface //短信 $NoticeSms->sendAdminRefund($order); //公众号 - $WechatTemplateList->sendAdminNewRefund($order); +// $WechatTemplateList->sendAdminNewRefund($order); //企业微信通知 $EnterpriseWechat->sendMsg(['order_id' => $order['order_id']]); break; @@ -474,7 +474,7 @@ class Notice implements ListenerInterface //短信 $NoticeSms->sendAdminPaySuccess($order); //公众号小程序 - $WechatTemplateList->sendAdminNewOrder($order); +// $WechatTemplateList->sendAdminNewOrder($order); //企业微信通知 $EnterpriseWechat->sendMsg(['order_id' => $order['order_id']]); break; diff --git a/crmeb/app/model/product/product/StoreProduct.php b/crmeb/app/model/product/product/StoreProduct.php index 3f8acb1ce..a86e74219 100644 --- a/crmeb/app/model/product/product/StoreProduct.php +++ b/crmeb/app/model/product/product/StoreProduct.php @@ -265,6 +265,18 @@ class StoreProduct extends BaseModel } } + /** + * 是否预售商品 + * @param $query + * @param $value + */ + public function searchIsPresaleAttr($query, $value) + { + if ($value >= 0) { + $query->where('presale', $value); + } + } + /** * 分类搜索器 * @param Model $query diff --git a/crmeb/app/services/agent/DivisionServices.php b/crmeb/app/services/agent/DivisionServices.php index f333d7835..eed195bf7 100644 --- a/crmeb/app/services/agent/DivisionServices.php +++ b/crmeb/app/services/agent/DivisionServices.php @@ -130,6 +130,8 @@ class DivisionServices extends BaseServices 'is_agent' => 0, 'is_staff' => 0, 'division_id' => $uid, + 'agent_id' => 0, + 'staff_id' => 0, 'division_type' => 1, 'division_status' => $data['division_status'], 'spread_uid' => 0, @@ -330,189 +332,199 @@ class DivisionServices extends BaseServices */ public function getDivisionPercent($uid, $storeBrokerageRatio, $storeBrokerageRatioTwo, $isSelfBrokerage) { - /** @var UserServices $userServices */ - $userServices = app()->make(UserServices::class); - $userInfo = $userServices->get($uid); - if ($userInfo['is_division'] == 1 && $userInfo['division_end_time'] > time()) { - /** 自己是事业部 */ - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = 0; - } else { - $storeBrokerageOne = 0; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = 0; - } - } elseif ($userInfo['is_agent'] == 1 && $userInfo['division_end_time'] > time()) { - /** 自己是代理商 */ - $divisionInfo = $userServices->get($userInfo['division_id']); - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; - } else { - $storeBrokerageOne = 0; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent']; - } - } elseif ($userInfo['is_staff'] == 1 && $userInfo['division_end_time'] > time()) { // 自己是员工 - /** 自己是员工 */ - $agentInfo = $userServices->get($userInfo['agent_id']); - $divisionInfo = $userServices->get($userInfo['division_id']); - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } else { - $storeBrokerageOne = 0; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent']; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } + $division_open = (int)sys_config('division_status', 0); + if (!$division_open) { + /** 代理商关闭 */ + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = $storeBrokerageRatioTwo; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = 0; } else { - /** 自己是普通用户 */ - $staffInfo = $userServices->get($userInfo['staff_id']); - $agentInfo = $userServices->get($userInfo['agent_id']); - $divisionInfo = $userServices->get($userInfo['division_id']); - if ($userInfo['staff_id']) { - /** 该用户为员工推广 */ - if ($userInfo['staff_id'] == $userInfo['spread_uid']) { - /** 员工直接下级 */ - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = $staffInfo['division_percent'] - $storeBrokerageOne; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + /** @var UserServices $userServices */ + $userServices = app()->make(UserServices::class); + $userInfo = $userServices->get($uid); + if ($userInfo['is_division'] == 1 && $userInfo['division_end_time'] > time()) { + /** 自己是事业部 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = 0; + } else { + $storeBrokerageOne = 0; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = 0; + } + } elseif ($userInfo['is_agent'] == 1 && $userInfo['division_end_time'] > time()) { + /** 自己是代理商 */ + $divisionInfo = $userServices->get($userInfo['division_id']); + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; + } else { + $storeBrokerageOne = 0; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent']; + } + } elseif ($userInfo['is_staff'] == 1 && $userInfo['division_end_time'] > time()) { // 自己是员工 + /** 自己是员工 */ + $agentInfo = $userServices->get($userInfo['agent_id']); + $divisionInfo = $userServices->get($userInfo['division_id']); + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } else { + $storeBrokerageOne = 0; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent']; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } + } else { + /** 自己是普通用户 */ + $staffInfo = $userServices->get($userInfo['staff_id']); + $agentInfo = $userServices->get($userInfo['agent_id']); + $divisionInfo = $userServices->get($userInfo['division_id']); + if ($userInfo['staff_id']) { + /** 该用户为员工推广 */ + if ($userInfo['staff_id'] == $userInfo['spread_uid']) { + /** 员工直接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = $staffInfo['division_percent'] - $storeBrokerageOne; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } else { + $storeBrokerageOne = $staffInfo['division_percent']; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } + } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['staff_id']) { + /** 员工间接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = $storeBrokerageRatioTwo; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } else { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = $staffInfo['division_percent'] - $storeBrokerageOne; + $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } } else { - $storeBrokerageOne = $staffInfo['division_percent']; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } - } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['staff_id']) { - /** 员工间接下级 */ - if ($isSelfBrokerage) { + /** 和员工的关系超过两级 */ $storeBrokerageOne = $storeBrokerageRatio; $storeBrokerageTwo = $storeBrokerageRatioTwo; $staffPercent = 0; $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } else { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = $staffInfo['division_percent'] - $storeBrokerageOne; - $agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent']; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; } - } else { - /** 和员工的关系超过两级 */ - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = $storeBrokerageRatioTwo; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } - } elseif ($userInfo['agent_id']) { - /** 该用户为代理商推广 */ - if ($userInfo['agent_id'] == $userInfo['spread_uid']) { - /** 代理商直接下级 */ - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } elseif ($userInfo['agent_id']) { + /** 该用户为代理商推广 */ + if ($userInfo['agent_id'] == $userInfo['spread_uid']) { + /** 代理商直接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } else { + $storeBrokerageOne = 0; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent']; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } + } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['agent_id']) { + /** 代理商间接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = $storeBrokerageRatioTwo; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } else { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; + $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; + } } else { - $storeBrokerageOne = 0; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent']; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } - } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['agent_id']) { - /** 代理商间接下级 */ - if ($isSelfBrokerage) { + /** 和代理商的关系超过两级 */ $storeBrokerageOne = $storeBrokerageRatio; $storeBrokerageTwo = $storeBrokerageRatioTwo; $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } else { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne; + $agentPercent = $agentInfo['division_percent'] - $storeBrokerageRatio - $storeBrokerageTwo; $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; } - } else { - /** 和代理商的关系超过两级 */ - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = $storeBrokerageRatioTwo; - $staffPercent = 0; - $agentPercent = $agentInfo['division_percent'] - $storeBrokerageRatio - $storeBrokerageTwo; - $divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent']; - } - } elseif ($userInfo['division_id']) { - /** 该用户为事业部推广 */ - if ($userInfo['division_id'] == $userInfo['spread_uid']) { - /** 事业部直接下级 */ - if ($isSelfBrokerage) { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; + } elseif ($userInfo['division_id']) { + /** 该用户为事业部推广 */ + if ($userInfo['division_id'] == $userInfo['spread_uid']) { + /** 事业部直接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; + } else { + $storeBrokerageOne = 0; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent']; + } + } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['division_id']) { + /** 事业部间接下级 */ + if ($isSelfBrokerage) { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = $storeBrokerageRatioTwo; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; + } else { + $storeBrokerageOne = $storeBrokerageRatio; + $storeBrokerageTwo = 0; + $staffPercent = 0; + $agentPercent = 0; + $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; + } } else { - $storeBrokerageOne = 0; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent']; - } - } elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['division_id']) { - /** 事业部间接下级 */ - if ($isSelfBrokerage) { + /** 和事业部的关系超过两级 */ $storeBrokerageOne = $storeBrokerageRatio; $storeBrokerageTwo = $storeBrokerageRatioTwo; $staffPercent = 0; $agentPercent = 0; $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; - } else { - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = 0; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne; } } else { - /** 和事业部的关系超过两级 */ + /** 没有任何代理商关系 */ $storeBrokerageOne = $storeBrokerageRatio; $storeBrokerageTwo = $storeBrokerageRatioTwo; $staffPercent = 0; $agentPercent = 0; - $divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo; + $divisionPercent = 0; } - } else { - /** 没有任何代理商关系 */ - $storeBrokerageOne = $storeBrokerageRatio; - $storeBrokerageTwo = $storeBrokerageRatioTwo; - $staffPercent = 0; - $agentPercent = 0; - $divisionPercent = 0; } } return [$storeBrokerageOne, $storeBrokerageTwo, $staffPercent, $agentPercent, $divisionPercent]; diff --git a/crmeb/app/services/message/SystemNotificationServices.php b/crmeb/app/services/message/SystemNotificationServices.php index 03b513f49..46e5901f8 100644 --- a/crmeb/app/services/message/SystemNotificationServices.php +++ b/crmeb/app/services/message/SystemNotificationServices.php @@ -122,14 +122,14 @@ class SystemNotificationServices extends BaseServices $info['content'] = $smsTem[$info['sms_id']] ?? ''; break; case 'is_wechat': - $wechat = $TemplateMessageServices->getOne(['notification_id' => $info['id'], 'type' => 1]); + $wechat = $TemplateMessageServices->getOne(['id' => $info['wechat_id'], 'type' => 1]); $info['templage_message_id'] = $wechat['id'] ?? ''; $info['tempkey'] = $wechat['tempkey'] ?? ''; $info['tempid'] = $wechat['tempid'] ?? ''; $info['content'] = $wechat['content'] ?? ''; break; case 'is_routine': - $wechat = $TemplateMessageServices->getOne(['notification_id' => $info['id'], 'type' => 0]); + $wechat = $TemplateMessageServices->getOne(['id' => $info['routine_id'], 'type' => 0]); $info['templage_message_id'] = $wechat['id'] ?? ''; $info['tempkey'] = $wechat['tempkey'] ?? ''; $info['tempid'] = $wechat['tempid'] ?? ''; diff --git a/crmeb/app/services/order/StoreOrderComputedServices.php b/crmeb/app/services/order/StoreOrderComputedServices.php index 9d37814d1..fd21102c9 100644 --- a/crmeb/app/services/order/StoreOrderComputedServices.php +++ b/crmeb/app/services/order/StoreOrderComputedServices.php @@ -440,8 +440,9 @@ class StoreOrderComputedServices extends BaseServices } } if (count($storePostage_arr)) { + $maxStorePostage = max($storePostage_arr); //获取运费计算中的最大值 - $storePostage = bcadd((string)$storePostage, (string)(max($storePostage_arr)), 2); + $storePostage = bcadd((string)$storePostage, (string)$maxStorePostage, 2); } } } @@ -462,7 +463,7 @@ class StoreOrderComputedServices extends BaseServices } $truePostageArr = []; foreach ($postageArr as $postitem) { - if ($postitem['sum'] == $storePostage) { + if ($postitem['sum'] == ($maxStorePostage ?? 0)) { $truePostageArr = $postitem['data']; break; } @@ -474,9 +475,9 @@ class StoreOrderComputedServices extends BaseServices } $tempId = $item['productInfo']['temp_id'] ?? 0; $tempPostage = $truePostageArr[$tempId] ?? 0; - $type = $temp_num[$tempId]['type']; $tempNumber = $temp_num[$tempId]['number'] ?? 0; if (!$tempId || !$tempPostage || !$tempNumber) continue; + $type = $temp_num[$tempId]['type']; $cartNumber = $item['cart_num']; if ((($cartAlready[$tempId]['number'] ?? 0) + $cartNumber) >= $tempNumber) { $price = isset($cartAlready[$tempId]['price']) ? bcsub((string)$tempPostage, (string)$cartAlready[$tempId]['price'], 6) : $tempPostage; diff --git a/crmeb/app/services/order/StoreOrderCreateServices.php b/crmeb/app/services/order/StoreOrderCreateServices.php index 4ffe21540..dccb2b7e2 100644 --- a/crmeb/app/services/order/StoreOrderCreateServices.php +++ b/crmeb/app/services/order/StoreOrderCreateServices.php @@ -129,7 +129,7 @@ class StoreOrderCreateServices extends BaseServices $wechatServices = app()->make(WechatUserServices::class); /** @var UserAddressServices $addressServices */ $addressServices = app()->make(UserAddressServices::class); - if ($shippingType === 1 && $virtual_type == 0) { + if ($shippingType == 1 && $virtual_type == 0) { if (!$addressId) { throw new ValidateException('请选择收货地址!'); } diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index 1a061a4ca..347d4a940 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -164,6 +164,7 @@ class StoreOrderServices extends BaseServices $data['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 $data['pay_weixin_open'] = (int)sys_config('pay_weixin_open') ?? 0;//微信支付 1 开启 0 关闭 $data['ali_pay_status'] = (bool)sys_config('ali_pay_status');//支付包支付 1 开启 0 关闭 + $data['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 return $data; } @@ -1552,6 +1553,7 @@ HTML; $data['offline_pay_status'] = (int)sys_config('offline_pay_status') ?? (int)2; $data['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 $data['pay_weixin_open'] = (int)sys_config('pay_weixin_open') ?? 0;//微信支付 1 开启 0 关闭 + $data['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 $data['store_self_mention'] = (int)sys_config('store_self_mention') ?? 0;//门店自提是否开启 /** @var SystemStoreServices $systemStoreServices */ $systemStoreServices = app()->make(SystemStoreServices::class); diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index 7b7e7e6fe..1addc12ef 100644 --- a/crmeb/app/services/product/product/StoreProductServices.php +++ b/crmeb/app/services/product/product/StoreProductServices.php @@ -494,12 +494,6 @@ class StoreProductServices extends BaseServices */ public function save(int $id, array $data) { - if (count($data['cate_id']) < 1) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_SELECT_PRODUCT_CATEGORY); - if (!$data['store_name']) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_ENTER_THE_PRODUCT_NAME); - - // $data['slider_image'] = []; - if (count($data['slider_image']) < 1) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_UPLOAD_SLIDER_IMAGE); - $detail = $data['attrs']; $attr = $data['items']; $cate_id = $data['cate_id']; @@ -1244,6 +1238,7 @@ class StoreProductServices extends BaseServices { $uid = (int)$request->uid(); $data['uid'] = $uid; + $storeInfo = $this->dao->getOne(['id' => $id, 'is_show' => 1, 'is_del' => 0], '*', ['description']); if (!$storeInfo) { throw new ValidateException('商品不存在'); @@ -1365,7 +1360,7 @@ class StoreProductServices extends BaseServices $vip_user = $uid ? app()->make(UserServices::class)->value(['uid' => $uid], 'is_money_level') : 0; if ($storeInfo['recommend_list'] != '') { $recommend_list = explode(',', $storeInfo['recommend_list']); - $data['good_list'] = get_thumb_water($this->getProducts(['ids' => $recommend_list], 12)); + $data['good_list'] = get_thumb_water($this->getProducts(['ids' => $recommend_list, 'is_del' => 0, 'is_show' => 1], 12)); $recommend_count = 12 - count($data['good_list']); if ($recommend_count) $data['good_list'] = array_merge($data['good_list'], get_thumb_water($this->getProducts(['is_good' => 1, 'is_del' => 0, 'is_show' => 1, 'vip_user' => $vip_user, 'not_ids' => $recommend_list], $recommend_count))); } else { diff --git a/crmeb/app/services/system/SystemMenusServices.php b/crmeb/app/services/system/SystemMenusServices.php index 7577c9b15..a60abcfff 100644 --- a/crmeb/app/services/system/SystemMenusServices.php +++ b/crmeb/app/services/system/SystemMenusServices.php @@ -240,13 +240,15 @@ class SystemMenusServices extends BaseServices public function getMenus($roles): array { $field = ['menu_name', 'pid', 'id']; + $where = ['is_del' => 0]; if (!$roles) { - $menus = $this->dao->getMenusRoule(['is_del' => 0], $field); + $menus = $this->dao->getMenusRoule($where, $field); } else { /** @var SystemRoleServices $service */ $service = app()->make(SystemRoleServices::class); - $ids = $service->value([['id', 'in', $roles]], 'GROUP_CONCAT(rules) as ids'); - $menus = $this->dao->getMenusRoule(['rule' => $ids], $field); + $roles = is_string($roles) ? explode(',', $roles) : $roles; + $ids = $service->getRoleIds($roles); + $menus = $this->dao->getMenusRoule(['rule' => $ids] + $where, $field); } return $this->tidyMenuTier(false, $menus); } diff --git a/crmeb/app/services/wechat/RoutineServices.php b/crmeb/app/services/wechat/RoutineServices.php index d9866237d..f6b2b9705 100644 --- a/crmeb/app/services/wechat/RoutineServices.php +++ b/crmeb/app/services/wechat/RoutineServices.php @@ -264,7 +264,7 @@ class RoutineServices extends BaseServices throw new ValidateException('静默授权失败'); } $routineInfo = [ - 'unionid' => $userInfoConfig['unionid'] ?? null + 'unionid' => $userInfoConfig['unionid'] ?? '' ]; /** @var QrcodeServices $qrcode */ $qrcode = app()->make(QrcodeServices::class); @@ -321,7 +321,7 @@ class RoutineServices extends BaseServices throw new ValidateException('静默授权失败'); } $routineInfo = [ - 'unionid' => $userInfoConfig['unionid'] ?? null + 'unionid' => $userInfoConfig['unionid'] ?? '' ]; /** @var QrcodeServices $qrcode */ $qrcode = app()->make(QrcodeServices::class); @@ -370,7 +370,7 @@ class RoutineServices extends BaseServices throw new ValidateException('静默授权失败'); } $routineInfo = [ - 'unionid' => $userInfoConfig['unionid'] ?? null + 'unionid' => $userInfoConfig['unionid'] ?? '' ]; /** @var QrcodeServices $qrcode */ $qrcode = app()->make(QrcodeServices::class); diff --git a/crmeb/crmeb/services/AliPayService.php b/crmeb/crmeb/services/AliPayService.php index 3f6b4e29d..8002b59bc 100644 --- a/crmeb/crmeb/services/AliPayService.php +++ b/crmeb/crmeb/services/AliPayService.php @@ -245,7 +245,7 @@ class AliPayService ['auth_app_id', ''], ['buyer_logon_id', ''], ['point_amount', ''], - ]); + ], false, false); //商户订单号 $postOrder['out_trade_no'] = $paramInfo['out_trade_no'] ?? ''; diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index 90aeaf2f4..2027492c4 100644 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -7634,7 +7634,9 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (386, 'print_type', 'radio', 'input', 86, '1=>易联云', 1, '', 0, 0, '\"1\"', '平台选择', '平台选择', 0, 1), (387, 'config_export_type', 'radio', 'input', 93, '1=>一号通', 1, '', 0, 0, '\"1\"', '电子面单类型', '电子面单类型', 0, 1), (388, 'customer_corpId', 'text', 'input', 69, '', 1, '', 100, 0, '\"\"', '企业ID', '小程序需要跳转企业微信客服的话需要配置此项', 0, 1), -(389, 'create_wechat_user', 'radio', 'input', '2', '1=>开启\r\n0=>关闭', '1', '', '0', '0', '0', '关注公众号是否生成用户', '关注公众号是否生成用户', '0', '1'); +(389, 'create_wechat_user', 'radio', 'input', '2', '1=>开启\r\n0=>关闭', '1', '', '0', '0', '0', '关注公众号是否生成用户', '关注公众号是否生成用户', '0', '1'), +(390, 'friend_pay_status', 'radio', 'input', '95', '1=>开启\r\n0=>关闭', '1', '', '0', '0', '0', '好友代付开关', '好友代付开关', '0', '1'); + -- -------------------------------------------------------- -- @@ -7703,7 +7705,8 @@ INSERT INTO `eb_system_config_tab` (`id`, `pid`, `title`, `eng_title`, `status`, (91, 64, '基础配置', 'logistics_basic', 1, 0, '', 3, 0), (92, 64, '阿里云配置', 'logistics_aliyun', 1, 0, '', 3, 0), (93, 66, '基础配置', 'electronic_basic', 1, 0, '', 3, 0), -(94, 66, '一号通配置', 'system_electronic_config', 1, 0, '', 3, 0); +(94, 66, '一号通配置', 'system_electronic_config', 1, 0, '', 3, 0), +(95, 23, '好友代付', 'friend_pay', 1, 0, '', 0, 0); -- -------------------------------------------------------- @@ -8804,6 +8807,8 @@ CREATE TABLE IF NOT EXISTS `eb_system_notification` ( `system_text` varchar(512) NOT NULL DEFAULT '' COMMENT '系统消息id', `app_id` int(11) NOT NULL DEFAULT '0' COMMENT 'app推送id', `sms_id` int(11) NOT NULL DEFAULT '0' COMMENT '短信id', + `wechat_id` int(10) NOT NULL DEFAULT '0' COMMENT '模版消息id', + `routine_id` int(10) NOT NULL DEFAULT '0' COMMENT '订阅消息id', `ent_wechat_text` varchar(512) NOT NULL DEFAULT '' COMMENT '企业微信消息', `variable` varchar(256) NOT NULL DEFAULT '' COMMENT '变量', `url` varchar(512) NOT NULL DEFAULT '' COMMENT '群机器人链接', @@ -8816,32 +8821,32 @@ CREATE TABLE IF NOT EXISTS `eb_system_notification` ( -- 转存表中的数据 `eb_system_notification` -- -INSERT INTO `eb_system_notification` (`id`, `mark`, `name`, `title`, `is_system`, `is_app`, `is_wechat`, `is_routine`, `is_sms`, `is_ent_wechat`, `system_title`, `system_text`, `app_id`, `sms_id`, `ent_wechat_text`, `variable`, `url`, `type`, `add_time`) VALUES -(1, 'bind_spread_uid', '绑定推广关系', '注册完成给上级发送', 1, 1, 1, 1, 0, 0, '绑定下级通知', '恭喜,又一员猛将将永久绑定到您的团队,用户{nickname}加入您的队伍!', 0, 0, '0', '{nikename}用户名', '', 1, 0), -(2, 'order_pay_success', '支付成功给用户发送', '支付成功给用户发送', 1, 1, 1, 1, 2, 0, '购买成功通知', '您购买的商品已支付成功,支付金额{pay_price}元,订单号{order_id},感谢您的光临!', 0, 440396, '0', '{order_id}订单号,{total_num}商品总数,{pay_price}支付金额', '', 1, 0), -(3, 'order_take', '确认收货提醒发送', '确认收货用户提醒发送', 1, 1, 1, 1, 2, 0, '确认收货通知', '亲,您的订单{order_id},商品{store_name}已确认收货,感谢您的光临!', 0, 440402, '0', '{order_id}订单号,{store_name}商品名称', '', 1, 0), -(4, 'price_revision', '改价提醒发送', '改价给用户提醒发送', 1, 1, 1, 0, 2, 0, '改价通知', '您的订单{order_id},实际支付金额已被修改为{pay_price}', 0, 440410, '0', '{order_id}订单号,{pay_price}订单金额', '', 1, 0), -(5, 'order_refund', '退款成功提醒发送', '退款给用户提醒发送', 1, 1, 1, 1, 0, 0, '退款成功通知', '您的订单{order_id}已同意退款,退款金额{refund_price}元。', 0, 0, '0', '{order_id}订单号,{refund_price}退款金额,{pay_price}订单金额', '', 1, 0), -(7, 'recharge_success', '充值成功提醒发送', '充值成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '充值成功通知', '您成功充值¥{price},现剩余余额¥{now_money}元', 0, 0, '0', '{order_id}充值订单,{price}充值金额,{now_money}现有余额', '', 1, 0), -(8, 'integral_accout', '积分到账提醒发送', '积分到账给用户提醒发送', 1, 1, 1, 1, 0, 0, '积分到账通知', '亲,您成功获得积分{gain_integral},现有积分{integral}', 0, 0, '0', '{order_id}订单号,{store_name}商品名称,{pay_price}支付金额,{gain_integral}获取积分,{integral}现有积分', '', 1, 0), -(9, 'order_brokerage', '佣金到账提醒发送', '佣金到账给用户提醒发送', 1, 1, 1, 1, 0, 0, '佣金到账通知', '亲,恭喜您成功获得佣金{brokerage_price}元', 0, 0, '0', '{goods_name}商品名称,{goods_price}商品金额,{brokerage_price}分佣金额', '', 1, 0), -(10, 'bargain_success', '砍价成功提醒发送', '砍价成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '砍价成功通知', '亲,好腻害!你的朋友们已经帮你砍到底价了,商品名称{title},底价{min_price}', 0, 0, '0', '{title}活动名称{min_price}最低价', '', 1, 0), -(11, 'order_user_groups_success', '拼团成功提醒发送', '拼团成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '拼团成功通知', '亲,您的拼团已经完成了,拼团名称{title},团长{nickname}', 0, 0, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), -(12, 'send_order_pink_fial', '拼团失败提醒发送', '拼团失败给用户提醒发送', 1, 1, 1, 1, 0, 0, '拼团失败通知', '亲,您的拼团失败,活动名称{title}', 0, 0, '0', '{title}活动名称{count}拼团人数', '', 1, 0), -(13, 'open_pink_success', '开团成功提醒发送', '开团成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '开团成功通知', '亲,您已成功参与拼团,活动名称{title}', 0, 0, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), -(14, 'user_extract', '提现成功提醒发送', '提现成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '提现成功通知', '亲,您成功提现佣金{extract_number}元', 0, 0, '0', '{extract_number}提现金额,{nickname}用户昵称,{date}提现时间', '', 1, 0), -(15, 'user_balance_change', '提现失败提醒发送', '提现失败给用户提醒发送', 1, 1, 1, 1, 0, 0, '提现失败通知', '亲,您发起的提现被驳回,返回佣金{extract_number}元', 0, 0, '0', '{extract_number}提现金额,{nickname}用户昵称,{date}提现时间,{message}失败原因', '', 1, 0), -(16, 'recharge_order_refund_status', '充值退款提醒发送', '充值退款给用户提醒发送', 1, 1, 1, 1, 0, 0, '充值退款通知', '亲,您充值的金额已退款,本次退款{refund_price}元', 0, 0, '0', '{refund_price}退款金额,{order_id}充值订单,{price}充值金额', '', 1, 0), -(17, 'send_order_refund_no_status', '退款申请未通过提醒发送', '退款申请未通过给用户提醒发送', 1, 1, 1, 1, 0, 0, '退款申请拒绝通知', '您好!您的订单{order_id}已拒绝退款。', 0, 0, '0', '{order_id}订单号,{store_name}商品名称,{pay_price}订单金额', '', 1, 0), -(18, 'send_order_apply_refund', '申请退款给客服发消息', '申请退款给客服发消息', 1, 1, 1, 0, 2, 1, '您有新的退款待处理', '您有一笔退款订单待处理,订单号{order_id}!', 0, 440407, '您有个订单退款请注意查收\\n订单号:{order_id}', '{admin_name}管理员,{order_id}订单号', '', 2, 0), -(19, 'admin_pay_success_code', '下单给客服发消息', '下单支付给客服发消息', 1, 1, 1, 0, 2, 1, '您有新的订单待处理', '您有一笔支付成功的订单待处理,订单号{order_id}!', 0, 440405, '您有个新订单请注意查收\\n订单号:{order_id}', '{admin_name}管理员,{order_id}订单号', '', 2, 0), -(20, 'order_deliver_success', '发货提醒发送', '发货用户提醒发送', 1, 1, 1, 1, 2, 0, '发货通知', '亲爱的用户{nickname}您的商品{store_name},订单号{order_id}已发货,请注意查收', 0, 441596, '0', '{nickname}用户昵称,{store_name}商品名称,{order_id}订单号,{delivery_name}配送员姓名,{delivery_id}配送员电话,{user_address}收货地址', '', 1, 0), -(21, 'order_postage_success', '发货快递提醒发送', '发货快递用户提醒发送', 1, 1, 1, 1, 2, 0, '发货通知', '亲爱的用户{nickname}您的商品{store_name},订单号{order_id}已发货,请注意查收', 0, 441596, '0', '{nickname}用户昵称,{store_name}商品名称,{order_id}订单号,{delivery_name}快递名称,{delivery_id}快递单号,{user_address}收货地址', '', 1, 0), -(22, 'send_order_pink_clone', '取消拼团提醒发送', '取消拼团给用户提醒发送', 1, 1, 1, 1, 0, 0, '取消拼团通知', '亲,您的拼团取消,活动名称{title}', 0, 0, '0', '{title}活动名称{count}拼团人数', '', 1, 0), -(23, 'can_pink_success', '参团成功提醒发送', '参团成功给用户提醒发送', 1, 1, 1, 1, 0, 0, '参团成功通知', '亲,您已成功参与拼团,活动名称{title}', 0, 0, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), -(24, 'kefu_send_extract_application', '提现申请给客服发消息', '提现申请给客服发消息', 1, 0, 1, 0, 0, 1, '你有个新的提现申请待处理', '您有一笔提现申请待处理,提现金额{money}!', 0, 0, '您有个提现申请请注意查收\\n>提现金额{money}', '{nickname}用户昵称,{money}提现金额', 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ae3s-safwea-aa', 2, 0), -(25, 'send_admin_confirm_take_over', '收货给客服发消息', '收货给客服发消息', 1, 0, 0, 0, 2, 1, '你有个新的用户收货待处理', '您有一笔订单已经确认收货,订单号{order_id}!', 0, 440408, '您有个订单确认收货\\n>订单号{order_id}', '{storeTitle}商品名称,{order_id}订单号', '', 2, 0), -(26, 'order_pay_false', '提醒付款通知', '提醒付款通知用户提醒发送', 1, 1, 1, 0, 2, 0, '提醒付款通知', '您有未付款订单,订单号为:{order_id},商品数量有限,请及时付款。', 0, 440409, '0', '', '', 1, 0); +INSERT INTO `eb_system_notification` (`id`, `mark`, `name`, `title`, `is_system`, `is_app`, `is_wechat`, `is_routine`, `is_sms`, `is_ent_wechat`, `system_title`, `system_text`, `app_id`, `sms_id`, `wechat_id`, `routine_id`, `ent_wechat_text`, `variable`, `url`, `type`, `add_time`) VALUES +(1, 'bind_spread_uid', '绑定推广关系', '注册完成给上级发送', 1, 0, 1, 1, 0, 0, '绑定下级通知', '恭喜,又一员猛将将永久绑定到您的团队,用户{nickname}加入您的队伍!', 0, 0, 31, 4, '0', '{nikename}用户名', '', 1, 0), +(2, 'order_pay_success', '支付成功给用户发送', '支付成功给用户发送', 1, 0, 1, 1, 2, 0, '购买成功通知', '您购买的商品已支付成功,支付金额{pay_price}元,订单号{order_id},感谢您的光临!', 0, 440396, 26, 12, '0', '{order_id}订单号,{total_num}商品总数,{pay_price}支付金额', '', 1, 0), +(3, 'order_take', '确认收货提醒发送', '确认收货用户提醒发送', 1, 0, 1, 1, 2, 0, '确认收货通知', '亲,您的订单{order_id},商品{store_name}已确认收货,感谢您的光临!', 0, 440402, 17, 3, '0', '{order_id}订单号,{store_name}商品名称', '', 1, 0), +(4, 'price_revision', '改价提醒发送', '改价给用户提醒发送', 1, 0, 1, 0, 2, 0, '改价通知', '您的订单{order_id},实际支付金额已被修改为{pay_price}', 0, 440410, 36, 0, '0', '{order_id}订单号,{pay_price}订单金额', '', 1, 0), +(5, 'order_refund', '退款成功提醒发送', '退款给用户提醒发送', 1, 0, 1, 1, 0, 0, '退款成功通知', '您的订单{order_id}已同意退款,退款金额{refund_price}元。', 0, 0, 18, 10, '0', '{order_id}订单号,{refund_price}退款金额,{pay_price}订单金额', '', 1, 0), +(7, 'recharge_success', '充值成功提醒发送', '充值成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '充值成功通知', '您成功充值¥{price},现剩余余额¥{now_money}元', 0, 0, 37, 11, '0', '{order_id}充值订单,{price}充值金额,{now_money}现有余额', '', 1, 0), +(8, 'integral_accout', '积分到账提醒发送', '积分到账给用户提醒发送', 1, 0, 1, 1, 0, 0, '积分到账通知', '亲,您成功获得积分{gain_integral},现有积分{integral}', 0, 0, 41, 14, '0', '{order_id}订单号,{store_name}商品名称,{pay_price}支付金额,{gain_integral}获取积分,{integral}现有积分', '', 1, 0), +(9, 'order_brokerage', '佣金到账提醒发送', '佣金到账给用户提醒发送', 1, 0, 1, 1, 0, 0, '佣金到账通知', '亲,恭喜您成功获得佣金{brokerage_price}元', 0, 0, 30, 1, '0', '{goods_name}商品名称,{goods_price}商品金额,{brokerage_price}分佣金额', '', 1, 0), +(10, 'bargain_success', '砍价成功提醒发送', '砍价成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '砍价成功通知', '亲,好腻害!你的朋友们已经帮你砍到底价了,商品名称{title},底价{min_price}', 0, 0, 27, 7, '0', '{title}活动名称{min_price}最低价', '', 1, 0), +(11, 'order_user_groups_success', '拼团成功提醒发送', '拼团成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '拼团成功通知', '亲,您的拼团已经完成了,拼团名称{title},团长{nickname}', 0, 0, 23, 6, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), +(12, 'send_order_pink_fial', '拼团失败提醒发送', '拼团失败给用户提醒发送', 1, 0, 1, 1, 0, 0, '拼团失败通知', '亲,您的拼团失败,活动名称{title}', 0, 0, 24, 15, '0', '{title}活动名称{count}拼团人数', '', 1, 0), +(13, 'open_pink_success', '开团成功提醒发送', '开团成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '开团成功通知', '亲,您已成功参与拼团,活动名称{title}', 0, 0, 28, 6, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), +(14, 'user_extract', '提现成功提醒发送', '提现成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '提现成功通知', '亲,您成功提现佣金{extract_number}元', 0, 0, 38, 2, '0', '{extract_number}提现金额,{nickname}用户昵称,{date}提现时间', '', 1, 0), +(15, 'user_balance_change', '提现失败提醒发送', '提现失败给用户提醒发送', 1, 0, 1, 1, 0, 0, '提现失败通知', '亲,您发起的提现被驳回,返回佣金{extract_number}元', 0, 0, 39, 2, '0', '{extract_number}提现金额,{nickname}用户昵称,{date}提现时间,{message}失败原因', '', 1, 0), +(16, 'recharge_order_refund_status', '充值退款提醒发送', '充值退款给用户提醒发送', 1, 0, 1, 1, 0, 0, '充值退款通知', '亲,您充值的金额已退款,本次退款{refund_price}元', 0, 0, 18, 11, '0', '{refund_price}退款金额,{order_id}充值订单,{price}充值金额', '', 1, 0), +(17, 'send_order_refund_no_status', '退款申请未通过提醒发送', '退款申请未通过给用户提醒发送', 1, 0, 1, 1, 0, 0, '退款申请拒绝通知', '您好!您的订单{order_id}已拒绝退款。', 0, 0, 18, 10, '0', '{order_id}订单号,{store_name}商品名称,{pay_price}订单金额', '', 1, 0), +(18, 'send_order_apply_refund', '申请退款给客服发消息', '申请退款给客服发消息', 1, 0, 0, 0, 2, 1, '您有新的退款待处理', '您有一笔退款订单待处理,订单号{order_id}!', 0, 440407, 0, 0, '您有个订单退款请注意查收\\n订单号:{order_id}', '{admin_name}管理员,{order_id}订单号', '', 2, 0), +(19, 'admin_pay_success_code', '下单给客服发消息', '下单支付给客服发消息', 1, 0, 0, 0, 2, 1, '您有新的订单待处理', '您有一笔支付成功的订单待处理,订单号{order_id}!', 0, 440405, 0, 0, '您有个新订单请注意查收\\n订单号:{order_id}', '{admin_name}管理员,{order_id}订单号', '', 2, 0), +(20, 'order_deliver_success', '发货提醒发送', '发货用户提醒发送', 1, 0, 1, 1, 2, 0, '发货通知', '亲爱的用户{nickname}您的商品{store_name},订单号{order_id}已发货,请注意查收', 0, 441596, 20, 5, '0', '{nickname}用户昵称,{store_name}商品名称,{order_id}订单号,{delivery_name}配送员姓名,{delivery_id}配送员电话,{user_address}收货地址', '', 1, 0), +(21, 'order_postage_success', '发货快递提醒发送', '发货快递用户提醒发送', 1, 0, 1, 1, 2, 0, '发货通知', '亲爱的用户{nickname}您的商品{store_name},订单号{order_id}已发货,请注意查收', 0, 441596, 16, 9, '0', '{nickname}用户昵称,{store_name}商品名称,{order_id}订单号,{delivery_name}快递名称,{delivery_id}快递单号,{user_address}收货地址', '', 1, 0), +(22, 'send_order_pink_clone', '取消拼团提醒发送', '取消拼团给用户提醒发送', 1, 0, 1, 1, 0, 0, '取消拼团通知', '亲,您的拼团取消,活动名称{title}', 0, 0, 24, 15, '0', '{title}活动名称{count}拼团人数', '', 1, 0), +(23, 'can_pink_success', '参团成功提醒发送', '参团成功给用户提醒发送', 1, 0, 1, 1, 0, 0, '参团成功通知', '亲,您已成功参与拼团,活动名称{title}', 0, 0, 23, 6, '0', '{title}活动名称,{nickname}团长,{count}拼团人数,{pink_time}开团时间', '', 1, 0), +(24, 'kefu_send_extract_application', '提现申请给客服发消息', '提现申请给客服发消息', 1, 0, 0, 0, 0, 1, '你有个新的提现申请待处理', '您有一笔提现申请待处理,提现金额{money}!', 0, 0, 0, 0, '您有个提现申请请注意查收\\n>提现金额{money}', '{nickname}用户昵称,{money}提现金额', 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ae3s-safwea-aa', 2, 0), +(25, 'send_admin_confirm_take_over', '收货给客服发消息', '收货给客服发消息', 1, 0, 0, 0, 2, 1, '你有个新的用户收货待处理', '您有一笔订单已经确认收货,订单号{order_id}!', 0, 440408, 0, 0, '您有个订单确认收货\\n>订单号{order_id}', '{storeTitle}商品名称,{order_id}订单号', '', 2, 0), +(26, 'order_pay_false', '提醒付款通知', '提醒付款通知用户提醒发送', 1, 0, 1, 0, 2, 0, '提醒付款通知', '您有未付款订单,订单号为:{order_id},商品数量有限,请及时付款。', 0, 440409, 40, 0, '0', '', '', 1, 0); -- --------------------------------------------------------