Commit e40e83ff by 王召彬

Merge branch 'master' into test

parents 458d109a 171c747c
# 2.0.29
- 添加分销代理者角色
# 2.0.28
- token里添加万人万店标识
# 2.0.27
- 公众号通知跳转url
# 2.0.26
- 添加新的支付来源常量
# 2.0.25 # 2.0.25
- 修改接口备注 - 修改接口备注
......
...@@ -11,7 +11,8 @@ class AuthEnum ...@@ -11,7 +11,8 @@ class AuthEnum
{ {
const SCOPE_BUYER = 1; //买家 const SCOPE_BUYER = 1; //买家
const SCOPE_EMPLOYEE = 2; //手艺人 const SCOPE_EMPLOYEE = 2; //手艺人
const SCOPE_AGENT = 2; // 店铺分销代理者
const SCOPE_SELLER = 3; //卖家 const SCOPE_SELLER = 3; //卖家
...@@ -19,11 +20,14 @@ class AuthEnum ...@@ -19,11 +20,14 @@ class AuthEnum
const SCOPE_SUPER_ADMIN = 5; //超级管理员 const SCOPE_SUPER_ADMIN = 5; //超级管理员
const AUTH_BACKEND = 100; const AUTH_BACKEND = 100;
const AUTH_FRONTEND = 101; const AUTH_FRONTEND = 101;
const AUTH_TYPE_SELLER = 200; //卖家授权 const AUTH_TYPE_SELLER = 200; //卖家授权
const AUTH_TYPE_EMPLOYEE = 201; //员工授权 const AUTH_TYPE_EMPLOYEE = 201; //员工授权
const AUTH_TYPE_AGENT = 201; //店铺分销代理者授权
const AUTH_TYPE_E_AND_S = 203; //选择授权(用户自己选择进行员工授权还是卖家授权) const AUTH_TYPE_E_AND_S = 203; //选择授权(用户自己选择进行员工授权还是卖家授权)
const AUTH_TYPE_BUYER = 204; //买家授权 const AUTH_TYPE_BUYER = 204; //买家授权
......
...@@ -197,6 +197,19 @@ class User ...@@ -197,6 +197,19 @@ class User
return false; return false;
} }
/**
* 是否是通过“万人万店”的小程序授权
*
* @return boolean 如果是 返回true
*/
public function isWrwd()
{
$wrwd = $this->getValue('isWrwd');
if($wrwd == 1) {
return true;
}
return false;
}
public function initUser($token) public function initUser($token)
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Date: 2018/10/9 * Date: 2018/10/9
* Time: 10:50 * Time: 10:50
*/ */
namespace Hdll\Services\Notice\Extensions\Notice; namespace Hdll\Services\Notice\Extensions\Notice;
use Hdll\Services\Notice\Common\WxMiniNotice; use Hdll\Services\Notice\Common\WxMiniNotice;
...@@ -12,51 +13,58 @@ use Hdll\Services\Notice\Enum\NoticeEnum; ...@@ -12,51 +13,58 @@ use Hdll\Services\Notice\Enum\NoticeEnum;
class MpSender implements SenderInterface class MpSender implements SenderInterface
{ {
private $sendType = NoticeEnum::TYPE_MP_SEND; private $sendType = NoticeEnum::TYPE_MP_SEND;
private $data; private $data;
private $unionId; private $unionId;
private $miniprogram; private $miniprogram;
private $sendData; private $sendData;
private $template; private $template;
public function __construct(string $unionId,array $miniprogram, array $sendData, string $template) public function __construct(string $unionId, array $miniprogram, array $sendData, string $template)
{ {
$this->unionId = $unionId; $this->unionId = $unionId;
$this->miniprogram = $miniprogram; $this->miniprogram = $miniprogram;
$this->sendData = $sendData; $this->sendData = $sendData;
$this->template = $template; $this->template = $template;
} }
public function format() public function format()
{ {
$this->data[$this->sendType] = [ $this->data[$this->sendType] = [
'unionId' => $this->unionId, 'unionId' => $this->unionId,
'template_id' => $this->template, 'template_id' => $this->template,
'miniprogram' => [ 'miniprogram' => [
'appid' => $this->miniprogram['appId'], //小程序appid 'appid' => $this->miniprogram['appId'], //小程序appid
'pagepath' => WxMiniNotice::generatePage( ],
$this->miniprogram['page'], 'data' => $this->sendData
$this->miniprogram['param'] ];
)//小程序页面 //小程序跳转(优先)
], if (isset($this->miniprogram['page'])) {
'data' => $this->sendData $this->data[$this->sendType]['pagepath'] = WxMiniNotice::generatePage(
]; $this->miniprogram['page'],
} $this->miniprogram['param']
);
public function getData() }
{ //url跳转
return $this->data === null?[]:$this->data; if (isset($this->miniprogram['url'])) {
} $this->data[$this->sendType]['url'] = $this->miniprogram['url'];
}
public function getSendType() }
{
return [$this->sendType]; public function getData()
} {
return $this->data === null ? [] : $this->data;
}
public function getSendType()
{
return [$this->sendType];
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment