作者 王晓刚
1 个管道 的构建 通过 耗费 26 秒

bug

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/8/21
* Time: 19:08
*/
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
class TestController extends HomeBaseController
{
/**
* 恢复父级id
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function test(){
$data = Db::name('my_user')->where(['status'=>3,'inviter_phone'=>['neq','']])->select()->toArray();
foreach($data as $key => $vo){
$result = Db::name('my_user')->where(['phone'=>$vo['inviter_phone']])->value('id');
if(!empty($result)){
Db::name('my_user')->where(['id'=>$vo['id']])->update(['pid'=>$result]);
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -185,6 +185,7 @@ a:hover {
ul,
ol {
list-style: none;
margin-top: 50px;
}
h1,
... ...
... ... @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
// $user = Db::name('user')->where('id',436)->find();
// $user = Db::name('user')->where('id',6)->find();
// cmf_update_current_user($user);
// session('user',null);
$userId = cmf_get_current_user_id();
... ...