58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\merchant\service;
|
|
|
|
use app\channel\service\ProductBaseService;
|
|
use app\core\Service;
|
|
|
|
use think\App;
|
|
|
|
/**
|
|
* 商户关联映射产品
|
|
* Class MerchantRelation
|
|
* @package app\merchant\controller
|
|
*/
|
|
class MerchantMappingProductService extends Service
|
|
{
|
|
|
|
/**
|
|
* 绑定数据表
|
|
* @var string
|
|
*/
|
|
public $table = 'merchant_mapping_product';
|
|
|
|
|
|
|
|
public function getOne($id)
|
|
{
|
|
$where['mapping_id'] = $id;
|
|
$where['status'] = 1;
|
|
$data = $this->db()->where($where)->find();
|
|
|
|
|
|
|
|
|
|
|
|
if ($data) {
|
|
$data['key'] = $data['product_key'];
|
|
// $data['service'] = ProductBaseService::instance()->getService($data['product_key']);
|
|
|
|
// if ($data['service']) {
|
|
// $data['key'] = $data['service']['key'];
|
|
//
|
|
// } else {
|
|
// return false;
|
|
// }
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
public function db($table = false)
|
|
{
|
|
$table = $table ? $table : $this->table;
|
|
$this->db = $this->app->db->name($table);
|
|
return $this->db;
|
|
}
|
|
}
|