12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * MpConfExtModel.php UTF-8
- *
- *
- * @date : 2021-03-08 11:13
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 9.0
- */
- namespace huomp\model\weixin;
- class MpConfAgentModel extends CommonModel {
- protected $table = 'mp_conf_agent';
- protected $pk = 'id';
- /* 开启自动写入时间戳字段 */
- protected $cache_key_prefix = '';
- protected $type
- = [
- 'id' => 'integer',
- 'conf_id' => 'integer',
- 'app_id' => 'integer',
- 'agent_id' => 'integer',
- 'advertiser_conf_id' => 'integer',
- 'create_time' => 'integer',
- 'update_time' => 'integer',
- ];
- public function conf() {
- return $this->belongsTo(MpConfModel::class, 'conf_id', 'id');
- }
- public function getInfoByConfAgent($conf_id, $agent_id) {
- $_map = [
- 'conf_id' => $conf_id,
- 'agent_id' => $agent_id,
- ];
- $_data = $this->where($_map)->find();
- if (is_object($_data)) {
- $_data->toArray();
- }
- return $_data;
- }
- }
|