コード例 #1
0
ファイル: handle.php プロジェクト: jinghuizhai/weixin
function recordRecommend($weixin_id)
{
    $user = new User();
    $result = $user->findByWeixin($weixin_id);
    if ($result) {
        $recommend = new Recommend();
        $result = $recommend->findDetailById($weixin_id);
        $str = "";
        foreach ($result as $key => $value) {
            $str = $str . $value['name'];
            if ($value['status'] == 0) {
                $str = $str . "(此用户已经停用)";
            }
            $str = $str . "," . $value['date'] . "\n";
        }
        if (empty($str)) {
            return '对不起,您还没有推荐记录,加油!';
        } else {
            return "您的推荐记录为:\n" . $str;
        }
    } else {
        return '您还没有登记,登记后才能推荐,请联系米蝶财务0371-86089000';
    }
}