You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.8 KiB
PHTML
67 lines
1.8 KiB
PHTML
4 years ago
|
<?php
|
||
|
|
||
|
namespace Admin\Model;
|
||
|
|
||
|
use Think\Model;
|
||
|
|
||
|
class PartnerVerifyModel extends Model
|
||
|
{
|
||
|
protected $tablePrefix = 'tab_';
|
||
|
public $VerifyStatus=[
|
||
|
"-1"=>"审核拒绝",
|
||
|
"0"=>"未审核",
|
||
|
"1"=>"审核通过"
|
||
|
];
|
||
|
public function getVerifyCompanyInfo($id)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
/**
|
||
|
* 新增
|
||
|
* @param [array]] $partner_info 公司信息
|
||
|
* @return void
|
||
|
*/
|
||
|
public function add_db($partner_info)
|
||
|
{
|
||
|
$verifydata = [
|
||
|
"partner_id"=>0,
|
||
|
"partner_name"=>$partner_info['partner'],
|
||
|
"verify_status"=>0,
|
||
|
"create_admin_id"=>UID,
|
||
|
"create_admin_account"=>$_SESSION['onethink_admin']['user_auth']['username'],
|
||
|
"create_time"=>time()
|
||
|
];
|
||
|
$verifydata['partner_info'] = json_encode($partner_info,JSON_UNESCAPED_UNICODE);
|
||
|
return $this->add($verifydata);
|
||
|
}
|
||
|
public function edit_db($partner_info)
|
||
|
{
|
||
|
if(!isset($partner_info['id'])){
|
||
|
return false;
|
||
|
}
|
||
|
$p_id = $partner_info['id'];
|
||
|
|
||
|
$verifydata = [
|
||
|
"partner_id"=>$p_id,
|
||
|
"partner_name"=>$partner_info['partner'],
|
||
|
"verify_status"=>0,
|
||
|
"create_admin_id"=>UID,
|
||
|
"create_admin_account"=>$_SESSION['onethink_admin']['user_auth']['username'],
|
||
|
"create_time"=>time(),
|
||
|
"verify_log"=>''
|
||
|
];
|
||
|
$verifydata['partner_info'] = json_encode($partner_info,JSON_UNESCAPED_UNICODE);
|
||
|
|
||
|
//判断是否存在
|
||
|
$has = $this->where("partner_id = {$p_id}")->find();
|
||
|
if($has){
|
||
|
//存在
|
||
|
$verifydata['id'] = $has['id'];
|
||
|
$res = $this->save($verifydata);
|
||
|
}else{
|
||
|
$res = $this->add($verifydata);
|
||
|
}
|
||
|
return $res;
|
||
|
}
|
||
|
|
||
|
}
|