作者 郭文星

'123'

@@ -14,10 +14,12 @@ class Base extends Api @@ -14,10 +14,12 @@ class Base extends Api
14 protected $AppID; 14 protected $AppID;
15 protected $AppSecret; 15 protected $AppSecret;
16 protected $qiniuUrl; 16 protected $qiniuUrl;
  17 + protected $imgUrl;
17 public $url_h5;//前端h5的首页地址 分销需要加参数 18 public $url_h5;//前端h5的首页地址 分销需要加参数
18 public function __construct(Request $request = null) 19 public function __construct(Request $request = null)
19 { 20 {
20 parent::__construct($request); 21 parent::__construct($request);
  22 + $this->imgUrl = 'http://cardverification.com:19998';
21 $this->qiniuUrl = 'https://coupon.xp.yn.cn'; 23 $this->qiniuUrl = 'https://coupon.xp.yn.cn';
22 $this->url_h5 = 'https://coupon.xp.yn.cn/h5/'; 24 $this->url_h5 = 'https://coupon.xp.yn.cn/h5/';
23 $this->AppID = config("site.appid");//微信小程序AppID 25 $this->AppID = config("site.appid");//微信小程序AppID
@@ -24,7 +24,7 @@ class Business extends Base @@ -24,7 +24,7 @@ class Business extends Base
24 $postParam = $this->request->param(); 24 $postParam = $this->request->param();
25 $this->postParam = $postParam; 25 $this->postParam = $postParam;
26 parent::_initialize(); 26 parent::_initialize();
27 - // $this->auth->id=3 ;//测试用 27 + $this->auth->id=3 ;//测试用
28 $postParam = $this->request->param(); 28 $postParam = $this->request->param();
29 $this->postParam = $postParam; 29 $this->postParam = $postParam;
30 if (empty($postParam['store_id'])) { 30 if (empty($postParam['store_id'])) {
@@ -40,7 +40,7 @@ class Business extends Base @@ -40,7 +40,7 @@ class Business extends Base
40 $storewhere['user_id']=$this->auth->id; 40 $storewhere['user_id']=$this->auth->id;
41 $staff = Db::name("verification_staff")->where($storewhere)->find(); 41 $staff = Db::name("verification_staff")->where($storewhere)->find();
42 if (empty($staff)) { 42 if (empty($staff)) {
43 - $this->error("暂无权限!"); 43 + $this->error("暂无权限!".$this->auth->id);
44 } 44 }
45 $this->staff = $staff; 45 $this->staff = $staff;
46 $this->staff_id = $staff['id']; 46 $this->staff_id = $staff['id'];
@@ -226,7 +226,7 @@ class Business extends Base @@ -226,7 +226,7 @@ class Business extends Base
226 226
227 foreach ($order['receive'] as $key => $value) { 227 foreach ($order['receive'] as $key => $value) {
228 if($order['receive'][$key]['image']){ 228 if($order['receive'][$key]['image']){
229 - $order['receive'][$key]['image']=$this->url_h5.$order['receive'][$key]['image']; 229 + $order['receive'][$key]['image']=$this->imgUrl.$order['receive'][$key]['image'];
230 } 230 }
231 } 231 }
232 $this->success("查询成功",$order); 232 $this->success("查询成功",$order);
@@ -236,6 +236,21 @@ class Business extends Base @@ -236,6 +236,21 @@ class Business extends Base
236 } 236 }
237 237
238 /** 238 /**
  239 + * 7.1修改订单电话 名称
  240 + */
  241 + public function updateorder(){
  242 + $id =$this->postParam['id'];
  243 + $name =$this->postParam['name'];
  244 + $phone =$this->postParam['phone'];
  245 + $res=Db::name('verification_order')->where(['id'=>$id])->update(['name'=>$name,'phone'=>$phone]);
  246 + if($res){
  247 + $this->success("修改成功");
  248 + }else{
  249 + $this->error("修改失败");
  250 + }
  251 + }
  252 +
  253 + /**
239 * 8、手动核销订单中的某个卡卷 254 * 8、手动核销订单中的某个卡卷
240 */ 255 */
241 public function ordercheckconsumption(){ 256 public function ordercheckconsumption(){
@@ -405,5 +420,18 @@ class Business extends Base @@ -405,5 +420,18 @@ class Business extends Base
405 $this->success("查询成功",$rows); 420 $this->success("查询成功",$rows);
406 } 421 }
407 422
  423 + /**
  424 + * 14、获取代理人二维码
  425 + */
  426 + public function getagentimg(){
  427 + $res=Db::name('verification_store')->where(['id'=>$this->store_id])->find();
  428 + if($res){
  429 + $img=$this->imgUrl.$res['agent_image'];
  430 + }else{
  431 + return $this->error("请求失败");
  432 + }
  433 + return $this->success("请求成功",$img);
  434 + }
  435 +
408 436
409 } 437 }
@@ -382,10 +382,35 @@ class Client extends Base @@ -382,10 +382,35 @@ class Client extends Base
382 } 382 }
383 383
384 /** 384 /**
385 - * 代理人邀请 385 + * 11、代理人邀请
386 */ 386 */
387 public function agentinvite(){ 387 public function agentinvite(){
388 - 388 + $name=$this->postParam['name'];
  389 + $phone=$this->postParam['phone'];
  390 + $group=$this->postParam['group'];
  391 + $user_id=$this->auth->id;
  392 + $verification_store_id=$this->store_id;
  393 + $type=1;
  394 + //先查询是否存在
  395 + $where['user_id']=['=',$user_id];
  396 + $where['verification_store_id']=['=',$verification_store_id];
  397 + $isexist=Db::name('verification_staff')->where($where)->find();
  398 + if (!empty($isexist)){
  399 + return $this->error("请勿重复提交");
  400 + }
  401 + $data=[
  402 + 'name'=>$name,
  403 + 'phone'=>$phone,
  404 + 'group'=>$group,
  405 + 'user_id'=>$user_id,
  406 + 'verification_store_id'=>$verification_store_id
  407 + ];
  408 + $res=Db::name('verification_staff')->insertGetId($data);
  409 + if ($res){
  410 + return $this->success("提交成功");
  411 + }else{
  412 + return $this->error("提交失败");
  413 + }
389 } 414 }
390 415
391 } 416 }