作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

隐私协议

@@ -109,8 +109,20 @@ class Company extends Backend @@ -109,8 +109,20 @@ class Company extends Backend
109 // 修改角色为公司 109 // 修改角色为公司
110 \app\admin\model\User::where('id',$row->user_id)->setField('group_id',1); 110 \app\admin\model\User::where('id',$row->user_id)->setField('group_id',1);
111 $msg = '通过成功'; 111 $msg = '通过成功';
  112 + // 发送消息
  113 + \app\mobile\model\Message::create([
  114 + 'user_id' => $row->user_id,
  115 + 'title' => '注册企业-成功',
  116 + 'content' => '您的加入企业申请已审核通过,您在本款APP的所有学习资料,您企业下的员工都可以免费使用哦。快去试试吧。'
  117 + ]);
112 } else { 118 } else {
113 $msg = '拒绝成功'; 119 $msg = '拒绝成功';
  120 + // 发送消息
  121 + \app\mobile\model\Message::create([
  122 + 'user_id' => $row->user_id,
  123 + 'title' => '注册企业-失败',
  124 + 'content' => '您的加入企业申请审核失败了,快去个人中心-账号管理中修改信息后重新申请吧。'
  125 + ]);
114 } 126 }
115 $result = $row->save(); 127 $result = $row->save();
116 Db::commit(); 128 Db::commit();
@@ -15,6 +15,12 @@ @@ -15,6 +15,12 @@
15 </div> 15 </div>
16 </div> 16 </div>
17 <div class="form-group"> 17 <div class="form-group">
  18 + <label class="control-label col-xs-12 col-sm-2">启动页用户协议及隐私协议:</label>
  19 + <div class="col-xs-12 col-sm-8">
  20 + <textarea id="c-agreement" class="form-control editor" rows="5" name="row[agreement]" cols="50">{$row.agreement|htmlentities}</textarea>
  21 + </div>
  22 + </div>
  23 + <div class="form-group">
18 <label class="control-label col-xs-12 col-sm-2">用户注册协议:</label> 24 <label class="control-label col-xs-12 col-sm-2">用户注册协议:</label>
19 <div class="col-xs-12 col-sm-8"> 25 <div class="col-xs-12 col-sm-8">
20 <textarea id="c-user_agreement" class="form-control editor" rows="5" name="row[user_agreement]" cols="50">{$row.user_agreement|htmlentities}</textarea> 26 <textarea id="c-user_agreement" class="form-control editor" rows="5" name="row[user_agreement]" cols="50">{$row.user_agreement|htmlentities}</textarea>
@@ -27,6 +33,12 @@ @@ -27,6 +33,12 @@
27 </div> 33 </div>
28 </div> 34 </div>
29 <div class="form-group"> 35 <div class="form-group">
  36 + <label class="control-label col-xs-12 col-sm-2">隐私协议:</label>
  37 + <div class="col-xs-12 col-sm-8">
  38 + <textarea id="c-privacy_agreement" class="form-control editor" rows="5" name="row[privacy_agreement]" cols="50">{$row.privacy_agreement|htmlentities}</textarea>
  39 + </div>
  40 + </div>
  41 + <div class="form-group">
30 <label class="control-label col-xs-12 col-sm-2">暂不登录提示:</label> 42 <label class="control-label col-xs-12 col-sm-2">暂不登录提示:</label>
31 <div class="col-xs-12 col-sm-8"> 43 <div class="col-xs-12 col-sm-8">
32 <textarea id="c-no_login" class="form-control editor" rows="5" name="row[no_login]" cols="50">{$row.no_login|htmlentities}</textarea> 44 <textarea id="c-no_login" class="form-control editor" rows="5" name="row[no_login]" cols="50">{$row.no_login|htmlentities}</textarea>
@@ -290,4 +290,22 @@ class Index extends Api @@ -290,4 +290,22 @@ class Index extends Api
290 } 290 }
291 $this->success('成功',compact('url')); 291 $this->success('成功',compact('url'));
292 } 292 }
  293 +
  294 + /**
  295 + * @ApiTitle (启动页用户协议及隐私协议)
  296 + * @ApiSummary (启动页用户协议及隐私协议)
  297 + * @ApiMethod (POST)
  298 + *
  299 + * @ApiReturn({
  300 + "code": 1,
  301 + "msg": "成功",
  302 + "time": "1599017563",
  303 + "data": "启动页用户协议及隐私协议内容" //协议内容
  304 + })
  305 + */
  306 + public function agreement()
  307 + {
  308 + $content = Db::name('mobile_config')->where('id',1)->value('agreement');
  309 + $this->success('成功', $content);
  310 + }
293 } 311 }
@@ -37,7 +37,7 @@ use Endroid\QrCode\QrCode; @@ -37,7 +37,7 @@ use Endroid\QrCode\QrCode;
37 */ 37 */
38 class User extends Api 38 class User extends Api
39 { 39 {
40 - protected $noNeedLogin = ['registerUser','agreementUser','registerCompany','agreementCompany','login','resetpwd','exam','noLogin','problemList','problemInfo']; 40 + protected $noNeedLogin = ['registerUser','agreementUser','registerCompany','agreementCompany','agreementPrivacy','login','resetpwd','exam','noLogin','problemList','problemInfo'];
41 protected $noNeedRight = ['*']; 41 protected $noNeedRight = ['*'];
42 42
43 public function _initialize() 43 public function _initialize()
@@ -213,6 +213,25 @@ class User extends Api @@ -213,6 +213,25 @@ class User extends Api
213 } 213 }
214 214
215 /** 215 /**
  216 + * @ApiWeigh (93)
  217 + * @ApiTitle (隐私协议)
  218 + * @ApiSummary (隐私协议)
  219 + * @ApiMethod (POST)
  220 + *
  221 + * @ApiReturn({
  222 + "code": 1,
  223 + "msg": "成功",
  224 + "time": "1599017563",
  225 + "data": "隐私协议内容" //协议内容
  226 + })
  227 + */
  228 + public function agreementPrivacy()
  229 + {
  230 + $content = Db::name('mobile_config')->where('id',1)->value('privacy_agreement');
  231 + $this->success('成功', $content);
  232 + }
  233 +
  234 + /**
216 * @ApiWeigh (91) 235 * @ApiWeigh (91)
217 * @ApiTitle (登录) 236 * @ApiTitle (登录)
218 * @ApiSummary (登录) 237 * @ApiSummary (登录)
此 diff 太大无法显示。