作者 郭文星

'123'

... ... @@ -14,10 +14,12 @@ class Base extends Api
protected $AppID;
protected $AppSecret;
protected $qiniuUrl;
protected $imgUrl;
public $url_h5;//前端h5的首页地址 分销需要加参数
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->imgUrl = 'http://cardverification.com:19998';
$this->qiniuUrl = 'https://coupon.xp.yn.cn';
$this->url_h5 = 'https://coupon.xp.yn.cn/h5/';
$this->AppID = config("site.appid");//微信小程序AppID
... ...
... ... @@ -24,7 +24,7 @@ class Business extends Base
$postParam = $this->request->param();
$this->postParam = $postParam;
parent::_initialize();
// $this->auth->id=3 ;//测试用
$this->auth->id=3 ;//测试用
$postParam = $this->request->param();
$this->postParam = $postParam;
if (empty($postParam['store_id'])) {
... ... @@ -40,7 +40,7 @@ class Business extends Base
$storewhere['user_id']=$this->auth->id;
$staff = Db::name("verification_staff")->where($storewhere)->find();
if (empty($staff)) {
$this->error("暂无权限!");
$this->error("暂无权限!".$this->auth->id);
}
$this->staff = $staff;
$this->staff_id = $staff['id'];
... ... @@ -226,7 +226,7 @@ class Business extends Base
foreach ($order['receive'] as $key => $value) {
if($order['receive'][$key]['image']){
$order['receive'][$key]['image']=$this->url_h5.$order['receive'][$key]['image'];
$order['receive'][$key]['image']=$this->imgUrl.$order['receive'][$key]['image'];
}
}
$this->success("查询成功",$order);
... ... @@ -236,6 +236,21 @@ class Business extends Base
}
/**
* 7.1修改订单电话 名称
*/
public function updateorder(){
$id =$this->postParam['id'];
$name =$this->postParam['name'];
$phone =$this->postParam['phone'];
$res=Db::name('verification_order')->where(['id'=>$id])->update(['name'=>$name,'phone'=>$phone]);
if($res){
$this->success("修改成功");
}else{
$this->error("修改失败");
}
}
/**
* 8、手动核销订单中的某个卡卷
*/
public function ordercheckconsumption(){
... ... @@ -405,5 +420,18 @@ class Business extends Base
$this->success("查询成功",$rows);
}
/**
* 14、获取代理人二维码
*/
public function getagentimg(){
$res=Db::name('verification_store')->where(['id'=>$this->store_id])->find();
if($res){
$img=$this->imgUrl.$res['agent_image'];
}else{
return $this->error("请求失败");
}
return $this->success("请求成功",$img);
}
}
... ...
... ... @@ -382,10 +382,35 @@ class Client extends Base
}
/**
* 代理人邀请
* 11、代理人邀请
*/
public function agentinvite(){
$name=$this->postParam['name'];
$phone=$this->postParam['phone'];
$group=$this->postParam['group'];
$user_id=$this->auth->id;
$verification_store_id=$this->store_id;
$type=1;
//先查询是否存在
$where['user_id']=['=',$user_id];
$where['verification_store_id']=['=',$verification_store_id];
$isexist=Db::name('verification_staff')->where($where)->find();
if (!empty($isexist)){
return $this->error("请勿重复提交");
}
$data=[
'name'=>$name,
'phone'=>$phone,
'group'=>$group,
'user_id'=>$user_id,
'verification_store_id'=>$verification_store_id
];
$res=Db::name('verification_staff')->insertGetId($data);
if ($res){
return $this->success("提交成功");
}else{
return $this->error("提交失败");
}
}
}
... ...