12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\api\dao\test;
- use app\api\dao\ZskkDefaultDao;
- use app\api\model\test\TestModel;
- use app\api\model\test\PublicTestModel;
- use think\facade\Log;
- use app\api\cache\ZskkCache;
- /**
- * 后台控制器基类
- * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
- */
- class TestDao extends ZskkDefaultDao {
- protected $flag = true;
- protected $logName = "TestDao";
- protected $redis_name = 'db_config_public';
- public function getTestData($params) {
- // if($this->$flag) {
- // TestModel::find();
- // } else {
- // TestModel::find()
- // }
- $this->log('自定义日志dao1');
- var_dump($this->getCache('xxx'));
- if($params['db']) {
- $res = "\n----dao-----\n".TestModel::find().PublicTestModel::find();
- $this->log('自定义日志dao2');
- return $res;
- }
- $this->log('自定义日志dao2');
- return "\n----dao-----\n";
- }
- public function seCache($v)
- {
- $a = $this->setCache('liuguiyan',$v,3600);
- return $a;
- }
- public function geCache($k)
- {
- $a = $this->getCache($k);
- return $a;
- }
- }
|