where(array('phone' => $phone))->save($all_data); if ($art != false) { $re['type'] = 1; $re['msg'] = '成功'; } else { $re['type'] = 2; $re['msg'] = '失败'; } } $this->ajaxReturn($re); } /** * 查询商家数量 * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function checkMerchant() { if (IS_POST) { $phone = I('post.phone'); $appid = I('post.appid'); $where['status'] = 1; $where['end_time'] = array('gt', time()); $art = M('retail_admin')->where(array('phone' => $phone, 'appid' => $appid))->find(); if ($art) { $count = M('retail_merchant')->where($where)->count(); if ($count) { $re['type'] = 0; $re['msg'] = $count; $re['phone'] = $art['phone']; $re['appid'] = $art['appid']; } else { $re['type'] = 1; $re['msg'] = '数据为空'; } } else { $re['type'] = 2; $re['msg'] = '合伙人信息查询为空'; } $this->ajaxReturn($re); } } }