1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /**
- * AgentRateLogic.php UTF-8
- *
- *
- * @date : 2018/5/24 13:59
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huo\logic\agent;
- use huo\model\agent\AgentRateModel;
- use huo\model\common\CommonModel;
- class AgentRateLogic extends CommonModel {
- /**
- * 通过渠道ID获取折扣信息
- *
- * @param string $agent_id
- *
- * @return array|bool
- */
- public function getInfoByAgentId($agent_id) {
- $_info = (new AgentRateModel())->getDetail($agent_id);
- return $_info;
- }
- /**
- * 获取默认折扣信息
- *
- *
- * @return array|bool
- */
- public function getDefaultInfo() {
- $_info = (new AgentRateModel())->getDefaultDetail();
- return $_info;
- }
- /**
- * 更新数据
- *
- * @param array $data
- *
- * @param int $agent_id
- *
- * @return bool|mixed
- */
- public function updateAgentRate($data = [], $agent_id) {
- $_map['id'] = $agent_id;
- return (new AgentRateModel())->updateData($data, $agent_id);
- }
- /**
- * 添加渠道
- *
- * @param array $data
- *
- * @return bool|mixed
- */
- public function addAgentRate($data) {
- $_id = (new AgentRateModel())->addData($data);
- return $_id;
- }
- }
|