71 行
2.0 KiB
PHP
可执行文件
71 行
2.0 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Sellapi\Controller;
|
|
use Think\Controller;
|
|
|
|
//[1.5.26]
|
|
|
|
/**
|
|
* 合伙人代理版本设置
|
|
* Class AgentController
|
|
* @package Sellapi\Controller
|
|
*/
|
|
class AgentController extends Controller
|
|
{
|
|
/**
|
|
* 修改代理级别
|
|
*/
|
|
public function editagent()
|
|
{
|
|
if (IS_POST) {
|
|
$juris = I('post.juris');
|
|
$phone = I('post.phone');
|
|
$all_data['juris'] = $juris;
|
|
$art = M('retail_admin')->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);
|
|
}
|
|
}
|
|
} |