예제 #1
0
 protected function _push_salesman($order, $title)
 {
     $order_id = $order['id'];
     $model = M()->table('zj_loan_order_salesman s')->join('zj_loan_salesman u on u.uid=s.uid');
     $mobile = $model->where(['s.order_id' => $order_id])->getField('u.mobile');
     if ($mobile) {
         $pusher = new \Common\Util\XgPush('zjsd');
         $pusher->sendMessage($mobile, ['title' => $title, 'order_id' => $order_id, 'content' => $order['id'] . ',' . $order['title'] . ',' . $order['realname']]);
     }
     // 发送短信给商家
     $company = M()->table('zj_loan_order o')->join('zj_loan_company c on c.id=o.company_id')->where(['o.type' => 3, 'o.id' => $order_id])->field('c.telephone')->find();
     if ($company && strlen($company['telephone']) == 11) {
         sms($company['telephone'], $title, '指尖分期');
     }
 }
예제 #2
0
 public function checkApply()
 {
     $id = I('get.id', 0, 'intval');
     $status = I('get.status', 0, 'intval');
     in_array($status, [-1, 1]) or $this->error('未知的处理状态:' . $status);
     $model = M('job_apply a')->join('__USER__ u on a.uid = u.uid');
     $apply = $model->find($id) or $this->error('找不到此报名信息!');
     $job_id = $apply['job_id'];
     $joinModel = M('job_join');
     $pusher = new \Common\Util\XgPush();
     if ($status == -1) {
         // 审核不能通过
         M('job_apply')->where('id=' . $id)->save(['reject_comment' => I('post.reject-comment', ''), 'close_time' => time(), 'status' => $status]);
         $pusher->sendMessage($apply['mobile'], ['title' => '不好意思,您的兼职报名未通过审核!', 'content' => I('post.reject-comment', '点击查看详情...'), 'url' => U('/job/user_my_apply_detail/id/' . $id . '@mobile')]);
     } elseif ($status == 1) {
         // 审核通过
         M('job_apply')->where('id=' . $id)->save(['close_time' => time(), 'status' => $status]);
         $pusher->sendMessage($apply['mobile'], ['title' => '您的兼职报名通过审核啦~', 'content' => '点击查看详情...', 'url' => U('/job/user_my_apply_detail/id/' . $id . '@mobile')]);
         if ($joinModel->where('job_id=' . $job_id . ' AND uid=' . $apply['uid'])->count() < 1) {
             $joinModel->add(['job_id' => $job_id, 'created' => time(), 'uid' => $apply['uid'], 'uname' => $apply['uname'], 'from_type' => 1, 'status' => 1]);
         }
     }
     // 更新待审数数及通过数
     $this->_updateStat($job_id);
     // 后退
     $this->success('操作成功!', $_SERVER['HTTP_REFERER']);
 }
예제 #3
0
/**
 * 推送APP信息
 *
 * @param int $uid 用户编号
 * @param string $tag 标签
 */
function app_push($uid, $content, $app = 'zjdx')
{
    $user = get_user($uid);
    if ($user) {
        $xg = new \Common\Util\XgPush($app);
        $xg->sendMessage($user['mobile'], $content);
    }
}
예제 #4
0
 protected function _push($mobile, $title, $content = null)
 {
     $pusher = new \Common\Util\XgPush();
     $pusher->sendMessage($mobile, ['title' => $title, 'content' => $content ?: '点击查看详情...', 'url' => U('/user/contract/@loan')]);
 }