12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?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;
- use huolib\constant\CommonConst;
- class MpConfExtModel extends CommonModel {
- protected $table = 'mp_conf_ext';
- protected $pk = 'conf_id';
- /* 开启自动写入时间戳字段 */
- protected $cache_key_prefix = '';
- protected $type
- = [
- 'conf_id' => 'integer',
- 'is_advertiser' => 'integer',
- 'create_time' => 'integer',
- 'update_time' => 'integer',
- ];
- public function conf() {
- return $this->belongsTo(MpConfModel::class, 'conf_id', 'id');
- }
- public function getAdvertiserList() {
- $_list = $this->with('conf')
- ->where(['is_advertiser' => CommonConst::STATUS_YES])
- ->select();
- if (is_object($_list)) {
- $_list = $_list->toArray();
- }
- $_new_list = [];
- foreach ($_list as $item) {
- $_new_list[$item['conf_id']] = $item['conf']['wx_name'];
- }
- return $_new_list;
- }
- }
|