1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\smartbc\model;
- use think\Model;
- class SmartbcConfig extends Model{
- protected $pk = 'id';
-
-
- public static function getConfig(int $miniapp_id){
- return self::where(['member_miniapp_id' => $miniapp_id])->find();
- }
-
- public static function getAllConfig(){
- return self::select();
- }
-
-
- public static function configs(array $param,int $miniapp_id){
- $rel = self::where(['member_miniapp_id' => $miniapp_id])->find();
- if(empty($rel)){
- $param['member_miniapp_id'] = $miniapp_id;
- return self::insert($param);
- }else{
- return self::where(['member_miniapp_id' => $miniapp_id])->update($param);
- }
- }
- }
|