41 lines
755 B
PHP
41 lines
755 B
PHP
<?php
|
|
|
|
namespace app\merchant\service;
|
|
|
|
use app\core\Service;
|
|
use think\admin\extend\CodeExtend;
|
|
|
|
/**
|
|
* 商户使用卡密
|
|
* Class CardService
|
|
* @package app\merchant\service
|
|
*/
|
|
class MobileService extends Service
|
|
{
|
|
/**
|
|
* 设置默认操作表
|
|
* @var string
|
|
*/
|
|
public $table = 'merchant_card_mobile';
|
|
|
|
# 提交订单
|
|
public function up($card, $mobile)
|
|
{
|
|
$info = $this->get($card);
|
|
if (!$info) {
|
|
$data['card'] = $card;
|
|
$data['mobile'] = $mobile;
|
|
$this->db()->insert($data);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function get($card)
|
|
{
|
|
$where['card'] = $card;
|
|
$data = $this->db()->where($where)->find();
|
|
|
|
return $data;
|
|
}
|
|
} |