hasOne(Admin::class, 'id', 'admin_id')->bind(['admin_name'=>'name']); } public function company() { return $this->hasOne(Company::class, 'id', 'company_id')->field('id,day_count,user_id'); } public function dataType() { return $this->hasOne(DictData::class, 'id', 'type')->bind(['type_name'=>'name']); } public function getExtendAttr($value){ if($value==null){ return []; }else{ return json_decode($value,true); } } public function updateTransactionPool($id, $transactionPool) { return TaskTemplate::where('id', $id)->save(['transaction_pool' => $transactionPool]); } }